2013-07-04 5 views
2

J'ai créé une copie git locale d'un repo svn avec les commandes suivantes:Créer une structure branche svn de git quand répertoire diffère

$ git svn init svn://host/path/to/repo/PROJECT/trunk workingcopy 
$ cd workingcopy 
$ git svn fetch 

Maintenant, je suis en train de créer une branche svn sans succès:

$ git svn branch -n mybranch -m "Branch for my things" 
Multiple branch paths defined for Subversion repository. 
You must specify where you want to create the branch with the --destination argument 

Dans .git/config Je n'ai aucune entrée sous [svn-remote "svn"] comme suggéré dans this answer. J'ai essayé d'ajouter branches = branches/*:refs/* mais tente de créer la branche sous le tronc:

Copying svn://host/path/to/repo/PROJECT/trunk at r6684 to svn://host/path/to/repo/PROJECT/trunk/branches/mybranch 

Que dois-je faire pour créer une branche au bon endroit?

Répondre

2

Ok, alors j'ai changé .git/config de:

[svn-remote "svn"] 
    url = svn://host/path/to/repo/PROJECT/trunk 
    fetch = trunk:refs/remotes/git-svn 

à:

[svn-remote "svn"] 
    url = svn://host/path/to/repo/PROJECT 
    fetch = trunk:refs/remotes/git-svn 
    branches = branches/*:refs/remotes/* 

Cela a fonctionné, mais je suis tombé sur des problèmes en essayant d'accéder à la branche d'un git sur une autre machine. À la fin, j'ai poussé mes changements à svn, puis supprimé mon repo git local et cloné correctement cette fois:

$ git svn clone --standard-layout --prefix=svn/ svn://host/path/to/repo/PROJECT 
Questions connexes