threads / discuss / 27880

git svn v1 migration, avoid re-clone whole repo

Subject: git svn v1 migration, avoid re-clone whole repo

## tl;dr

2 messages between Jul 21, 2011 and Jul 23, 2011.

replies: 1people: 2as markdown or json

rupert THURNER· Jul 21, 2011, 22:47 UTC · lore
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· Jul 23, 2011, 17:03 UTC · re: rupert THURNER · lore

Re: git svn v1 migration, avoid re-clone whole repo

Hi Rupert,
Show 11 quoted lines
> 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

← back to recent threads