svn2git: Cannot setup tracking information
Asked Answered
I

4

10

I am trying to migrate a SVN project to git with thel help of svn2git. When executing the command it exits with the following error:

Running command: git branch --track "0.0.9" "remotes/svn/0.0.9"
fatal: Cannot setup tracking information; starting point 'remotes/svn/0.0.9' is not a branch. 

Started it with:

 svn2git http://<host>/<project>

I can't find any solution for it and it seems not many users has the same problem.

What can I do to solve this problem?

Ignaz answered 25/7, 2013 at 7:59 Comment(4)
What command did you execute?Curtiscurtiss
Edited the start post with execution commandIgnaz
Try running it witr -v, might print some useful debugging information, including output from git which made it believe there is such a remote branch.Curtiscurtiss
this should fix it: github.com/nirvdrum/svn2git/issues/132#issuecomment-31453436Transported
C
7

I had the same problem using Debian Sid (the version of "git" is 1:1.8.3.2-1). Before I already failed on Debian Squeeze using the stock "git" package (1:1.7.2.5-3). Finally I ended up using the squeeze-backport repository (1:1.7.10.4-1~bpo60+1), and now it works.

What version of Git are you using?

Chinkapin answered 8/8, 2013 at 10:54 Comment(8)
I ran into the same problem, git 1.8.1.3 works fine but updating to 1.8.3.3 generates the mentioned error.Ritualism
Sorry, for the late reaction. Downgrading to a 1.7 works for me also. Thanks for your answer!Ignaz
I also needed to downgrade from git 1.8.4 to 1.7.12.4 for the tracking to work. Doing this with Homebrew was easy enough: cd /user/local/Library/Formula && git checkout 7f1a8c0 /usr/local/Library/Formula/git.rb && brew unlink git && brew install git.Labialize
I have the same problem with Homebrew-installed git 1.8.4. Using Apple-installed /usr/bin/git 1.8.3.1 let me create the tracking branches.Semiology
Thank you for the great information. Had the same issue, was using v1.8.4Giddings
Git 1.8.3.1 is the last version that works with the current release 2.2.2 of svn2git. A few days ago a fix was integrated into svn2git, but there's no official release yet. Here's the GitHub issue] if you want to look into it (apparently the fix is pretty simple, just a command line option of git branch that needed to be removed).Springhouse
@Jason McCreary I'm glad that it works now for you, happy migrating to Git =)Transported
@Ignaz normally my answer should be accepted because using an older Git release is not the solution ;-)Transported
T
7

this should fix it:

Changing this line https://github.com/nirvdrum/svn2git/blob/master/lib/svn2git/migration.rb#L319
from run_command("git branch --track \"#{branch}\" \"remotes/svn/#{branch}\"")
to run_command("git branch \"#{branch}\" \"remotes/svn/#{branch}\"") should fix it.

At least it works now for me without any issues.

you can find the migration.rb file on Windows under C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\svn2git-2.2.2\lib\svn2git or something like this

https://github.com/nirvdrum/svn2git/issues/132#issuecomment-31453436

Transported answered 2/1, 2014 at 14:15 Comment(4)
This is still necessary on Ubuntu 14.04, so presumably a new release hasn't been push to wherever gem install downloads packages from.Waylay
I don't know why there is no new release but they should push one to solve the problem. But I, personally, think the solution which I have mentioned is the best solution and should work on all systems and be compatible with them. But I didn't test this.Transported
I updated my svn2git and it fixed the issue. gem update svn2gitBookkeeping
right Nate, this is now officially fixed and releasedTransported
O
2

I would like to add a quick and dirty solution to this without changing code!

Every time you get the error, just manually change branch and continue your svn2git command.

so to go through the workflow:

Running the command

svn2git ....

Got the error

Running command: git branch --track "0.0.9" "remotes/svn/0.0.9"
fatal: Cannot setup tracking information; starting point 'remotes/svn/0.0.9' is not a branch. 

Manually change branch (Copy the Running command: line and removing --track)

branch "0.0.9" "remotes/svn/0.0.9"

Continuing with svn2git

svn2git ...

note ... after the svn2git above is whatever your svn2git command is

Ostrowski answered 6/4, 2014 at 13:10 Comment(1)
this can take a while when you have many branches and have to do this manually instead of changing the code (so it works always)Transported
I
1

If you have a small number of branches and don't want to downgrade git, here's a way to workaround the issue. Run "git branch -r" to get a list of the branches. Then run the following for each branch (named svn/next_branch for example):

$ git branch "next_branch" "remotes/svn/next_branch"

The only difference is the "--track" option is removed.

That was the fix applied for this Github Issue

Illegitimate answered 13/12, 2013 at 18:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.