Search code examples
gitsvngit-svn

How to choose --prefix for git svn clone


When I try git-svn clone, I get a warning:

WARNING: --prefix is not given, defaulting to empty prefix.
     This is probably not what you want! In order to stay compatible
     with regular remote-tracking refs, provide a prefix like
     --prefix=origin/ (remember the trailing slash), which will cause
     the SVN-tracking refs to be placed at refs/remotes/origin/*.

--prefix is not mentioned in the git book chapter on git-svn. Various web pages recommend using --prefix (tfnico, objectparters), but fail to explain what I should call it. Is it just an arbitrary name, or should it match something in the SVN repository?


Solution

  • You should name it as you would a regular git remote, that is, pretend the SVN repository is a remote git repository; what name do you want to give it? --prefix=origin/ like the warning says is a safe choice unless you want a different origin remote.