# importing history

6 messages from 2011-06-29 to 2011-06-30. Participants: Mihamina Rakotomandimby, Christof Krüger, Andreas Schwab.
Thread: https://gitlist.dev/t/27729

## Mihamina Rakotomandimby, 2011-06-29 13:45

Subject: importing history
Message-ID: <20110629164514.58175480.mihamina@bbs.mg>
URL: https://gitlist.dev/e/20110629164514.58175480.mihamina%40bbs.mg

```
Hi,

Still newcomer in GIT ;-)

Let the nurpawiki SVN repo here:
http://code.google.com/p/nurpawiki/source/checkout

I know how to clone it using "git svn clone ..."
"git log" shows the whole history: fine!

Then I created an account in a forge (like github or so...), where I
had to clone an empty GIT repository in order to begin to work.
I dont have admin access to the forge, so no "scp" to the repo
hosting possible.

Now, I have 2 "local" repos:
- the one from the SVN
- the empty one from the forge

I am looking for a document that would teach me how to "import" the
"from-svn" into the empty one. What are the keywords for that action
(to help me searching)?

After I do that, I will just have to push to the previously empty
origin and I'm done.

Thanks for your help.


-- 
RMA.

```

## Christof Krüger, 2011-06-29 14:25

Subject: Re: importing history
Message-ID: <348bd65ad7c7690bcce553fe3c8e0bfb.squirrel@mail.localhost.li>
URL: https://gitlist.dev/e/348bd65ad7c7690bcce553fe3c8e0bfb.squirrel%40mail.localhost.li
In-Reply-To: <20110629164514.58175480.mihamina@bbs.mg>

```
Hi,

> Then I created an account in a forge (like github or so...), where I
> had to clone an empty GIT repository in order to begin to work.
> I dont have admin access to the forge, so no "scp" to the repo
> hosting possible.
Why did you have to clone an empty repository? It should be enough to add
the correct remote config directly in your "from-svn" repository and just
push it.

> Now, I have 2 "local" repos:
> - the one from the SVN
> - the empty one from the forge

Now that you already have cloned the empty repository you can just look at
the remote configuration in it:

 git config --list|grep remote

You should see something like the following:

remote.origin.url=user@example.com/path/to/repository.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

Go to your from-svn repository and add the above configuration, then "git
push origin master".

Good luck!

Regards,
  Chris

```

## Andreas Schwab, 2011-06-29 16:56

Subject: Re: importing history
Message-ID: <m2sjqswp85.fsf@igel.home>
URL: https://gitlist.dev/e/m2sjqswp85.fsf%40igel.home
In-Reply-To: <348bd65ad7c7690bcce553fe3c8e0bfb.squirrel@mail.localhost.li>

```
Christof Krüger <git@christof-krueger.de> writes:

> Now that you already have cloned the empty repository you can just look at
> the remote configuration in it:
>
>  git config --list|grep remote
>
> You should see something like the following:
>
> remote.origin.url=user@example.com/path/to/repository.git
> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
>
> Go to your from-svn repository and add the above configuration, then "git
> push origin master".

Careful.  git svn uses the remotes namespace in a non-std way.  Better
to locally clone the from-svn repository into a new one, then use "git
remote add origin user@example.com/path/to/repository.git" to add the
remote repository.  Then you can safely push the master branch.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Christof Krüger, 2011-06-29 17:02

Subject: Re: importing history
Message-ID: <1309366960.2417.55.camel@oxylap>
URL: https://gitlist.dev/e/1309366960.2417.55.camel%40oxylap
In-Reply-To: <m2sjqswp85.fsf@igel.home>

```
On Mi, 2011-06-29 at 18:56 +0200, Andreas Schwab wrote:
> Careful.  git svn uses the remotes namespace in a non-std way.  Better
> to locally clone the from-svn repository into a new one, then use "git
> remote add origin user@example.com/path/to/repository.git" to add the
> remote repository.  Then you can safely push the master branch.
Doesn't git svn use svn-remove.svn.* and not remote.*?
I've been doing that before and it worked for me.

"git svn dcommit" and "git push" are orthogonal to my understanding. If
you have an example, where git svn doesn't play well with "usual" git
remotes, I'd be happy to see them.

Regards,
  Chris 

```

## Andreas Schwab, 2011-06-29 21:35

Subject: Re: importing history
Message-ID: <m262nofhid.fsf@igel.home>
URL: https://gitlist.dev/e/m262nofhid.fsf%40igel.home
In-Reply-To: <1309366960.2417.55.camel@oxylap>

```
Christof Krüger <git@christof-krueger.de> writes:

> On Mi, 2011-06-29 at 18:56 +0200, Andreas Schwab wrote:
>> Careful.  git svn uses the remotes namespace in a non-std way.  Better
>> to locally clone the from-svn repository into a new one, then use "git
>> remote add origin user@example.com/path/to/repository.git" to add the
>> remote repository.  Then you can safely push the master branch.
> Doesn't git svn use svn-remove.svn.* and not remote.*?

I'm not talking about the config options, but of the ref namespace.  If
your svn repository would have a branch named origin it would be stored
as refs/remotes/origin by git svn, which would conflict with "git remote
add origin ..."

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Christof Krüger, 2011-06-30 05:00

Subject: Re: importing history
Message-ID: <1309410043.2417.70.camel@oxylap>
URL: https://gitlist.dev/e/1309410043.2417.70.camel%40oxylap
In-Reply-To: <m262nofhid.fsf@igel.home>

```
On Mi, 2011-06-29 at 23:35 +0200, Andreas Schwab wrote:
> I'm not talking about the config options, but of the ref namespace.  If
> your svn repository would have a branch named origin it would be stored
> as refs/remotes/origin by git svn, which would conflict with "git remote
> add origin ..."
Ah, thanks for explaining.
As of now, I only had to do with rather "dump" SVN repositories with
only a trunk (or only non-stdlayout branches I didn't care about
anyways).

But do you think things could be seriously screwed up because of this?
Or would just one of the commands gracefully fail, leaving the
unexperienced user with an error message he doesn't understand?

Chris.

```
