# git svn v1 migration, avoid re-clone whole repo

2 messages from 2011-07-21 to 2011-07-23. Participants: rupert THURNER, Thomas Ferris Nicolaisen.
Thread: https://gitlist.dev/t/27880

## rupert THURNER, 2011-07-21 22:47

Subject: git svn v1 migration, avoid re-clone whole repo
Message-ID: <CAJs9aZ-h8J_WYC1cXy9HojwArO8EqWSZnoZ1=LdrqHxeJxz_BQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJs9aZ-h8J_WYC1cXy9HojwArO8EqWSZnoZ1%3DLdrqHxeJxz_BQ%40mail.gmail.com

```
hi,

is there any other means of upgrading to the new svn layout but
cloning the repository afresh again? the error message i get is:

$ git svn rebase
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
        .git/svn
        (required for this version (1.7.5.4) of git-svn) does not exist.
Done migrating from a git-svn v1 layout
Unable to determine upstream SVN information from working tree history

rupert

```

## Thomas Ferris Nicolaisen, 2011-07-23 17:03

Subject: Re: git svn v1 migration, avoid re-clone whole repo
Message-ID: <CAEcj5uXUbJGj0Gjji-dRcsQuoQ3kP-LXcXGjtwFiZLFP5c-R6g@mail.gmail.com>
URL: https://gitlist.dev/e/CAEcj5uXUbJGj0Gjji-dRcsQuoQ3kP-LXcXGjtwFiZLFP5c-R6g%40mail.gmail.com
In-Reply-To: <CAJs9aZ-h8J_WYC1cXy9HojwArO8EqWSZnoZ1=LdrqHxeJxz_BQ@mail.gmail.com>

```
Hi Rupert,

> is there any other means of upgrading to the new svn layout but
> cloning the repository afresh again? the error message i get is:
>
> $ git svn rebase
> Migrating from a git-svn v1 layout...
> Data from a previous version of git-svn exists, but
>        .git/svn
>        (required for this version (1.7.5.4) of git-svn) does not exist.
> Done migrating from a git-svn v1 layout
> Unable to determine upstream SVN information from working tree history
>

Can you say in more concrete steps how you created the repository
where this happens?

I've seen this error message in repositories that are clones of
git-svn repositories. They are "simple" git repositories with no link
established to the SVN repository (no notion of svn in the
.git/config). If this is the case, read on:

I usually fix this by initializing git svn in the repo:

> git svn init [same params as the initial git svn clone] [svn url]

And then you have to update the latest git-svn ref to point at the
last git-svn commit. Usually this goes something like:

> git update-ref refs/remotes/git-svn refs/remotes/origin/master

... assuming that the git-svn repo you cloned from is a remote repo
with the name "origin".

Note that in a git svn clone with branches the above git-svn reference
will be probably be branch name instead.

Hope this helps,

-Thomas

```
