Search code examples
gitsvngit-svngit-config

Understanding git-svn configuration


git-svn man page has this example:

[svn-remote "project-a"]
        url = http://server.org/svn
        fetch = trunk/project-a:refs/remotes/project-a/trunk

So, as I understand it, it configures the svn to fetch changes from http://server.org/svn/trunk/project-a, which is a result of concatenation of the relative path of trunk/project-a and the root url, which is http://server.org/svn. Is this correct?

Also, I am confused by the : separator in the fetch. Does it serve as a separator of elements in the list, or a tuple?

And finally, why is trunk/project-a repeated twice in this list, and why does it have refs/remotes the second time?


Solution

  • fetch's value is a refspec, which consists of a remote and a local part. The part on the left of the colon is the path in the remote (SVN) repository, while the part on the right of the colon is the corresponding ref in the local (git) repository. You can find more information on the git-config (remote.*), and git-fetch manpages. I seem to recall there were some differences in git-svn handling of wildcards from git's normal wildcard handling in refspecs.