svn2git: Cannot setup tracking information

杀马特。学长 韩版系。学妹 提交于 2019-12-04 01:40:49

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?

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

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

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!