Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

git svn - Why does "git svn fetch" command seem to be stuck and does nothing?

EDIT: Workaround. Now we understand the issue, here is the solution: do

git svn fetch -r REVISION:HEAD

where REVISION is the number of the svn commit of the branch creation.


I've been happy using git svn to work on the trunk of my project for a while, but now I need to track branches also.

I've tried to initialize a new repository to do that with

git init
git svn init https://svnserver/svn/repository

Then I edit the local configuration file to reflect the structure of my svn repository:

[svn-remote "svn"]
    url = https://svnserver/svn/repository
    fetch = path/to/trunk:refs/remotes/trunk
    branches = path/to/branches/*:refs/remotes/branches/*

Then I run

git svn fetch

And this command just does nothing:

  • It does not terminates
  • It does not write anything in the console output
  • It does not use any CPU, nor create files

I gave up after 10 minutes

I've checked that the svn repository is working, because git svn fetch works perfectly on my git repository where I track only the trunk.

Is this a bug or am I missing something here ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It becomes verbose after fetching the first relevant commit.

But until it fetches that commit, you can ensure the command is working properly by checking the .gitsvn.metadata file. The lines branches-maxRev = 123 and tags-maxRev = 123 will keep updating and increasing their numbers as it works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...