Search code examples
gitgit-svn

Git SVN fetch nothing occasionally


Below svn branches have been added into .git/config file.

[svn-remote "svnb02"]
        url = https://svn/repos/Project/branches/b02
        fetch = :refs/remotes/git-svn-b02
[svn-remote "svnb03"]
        url = https://svn/repos/Project/branches/b03
        fetch = :refs/remotes/git-svn-b03

But only "svnb03" can be fetched using below command:

git svn fetch -R svnb03 -r HEAD

For "svnb02", below command will return quietly without fetching anything.

git svn fetch -R svnb02 -r HEAD

Any commed will be welcome.


Solution

  • Maybe branch HEAD is not being set. Look at .git/remotes/svnb02/HEAD. If it's missing or not up-to-date, that might account for your problem.

    Git has code to find HEAD in this situation, but apparently git svn doesn't; there's a patch in the works about this.

    If that's okay, then I'd look for a weird entry to a svn. or remote.svn. variable in the config file or something weird in the .git/remotes directory.

    This is all guesswork. A weird situation usually has a weird explanation. Good luck.

    EDIT -- I'm assuming that svnb02 had new revisions when you had this problem. Your command is only going to fetch from svn if there are un-fetched revisions.