2013-07-04 117 views
2

我創建一個SVN回購的用下面的命令在本地git的副本:從混帳創建SVN分支時,目錄結構不同

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

現在,我想沒有成功創建SVN分支:

$ 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 

.git/config我沒有[svn-remote "svn"]下的任何條目,如this answer建議。我嘗試添加branches = branches/*:refs/*但這種嘗試的樹幹下創建分支:

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

什麼我需要做的創建在正確的位置的一個分支?

回答

2

好了,所以我改變.git/config來自:

[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/* 

這個工作,但我遇到了試圖從一個混帳回購協議訪問另一臺機器上的分支問題。最後,我將我的更改推送到svn,然後刪除了我的本地git repo並在此次正確克隆:

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