Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose --prefix for git svn clone

Tags:

git

svn

git-svn

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?

like image 912
Tor Klingberg Avatar asked Aug 04 '15 10:08

Tor Klingberg


People also ask

How do I clone a Git repository in SVN?

# 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 ...

Can I use Git and SVN at the same time?

No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.

What does git SVN clone do?

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.


Video Answer


1 Answers

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.

like image 145
darkfeline Avatar answered Nov 14 '22 23:11

darkfeline