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?
# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...
No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.
The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With