我没有太多 svn 经验,但我习惯使用 git。
我有以下 svn 存储库结构和修订。
https://server/svn/solution/trunk/solution.sln @r100
https://server/svn/solution/trunk/project1/project1.csproj @r150
https://server/svn/solution/trunk/project2/ project2.csproj @ r160https://server/svn/solution/branches/solution.sln @r100
https: //server/svn/solution/branches/project1/project1.csproj @ r200 https
://server/svn/solution/branches/project2/ project2.csproj @ r350
当我克隆存储库时
git svn clone https://server/svn/solution --stdlayout
我得到了一切
(master)$ git branch -a
* master
remotes/project1
remotes/project2
remotes/trunk
当我想为远程分支创建本地分支时
(master)$ git checkout -b local-project1 project1
当我结帐分支时,我得到的只是 project1。该分支不包含任何来自
为了解决这个问题,我尝试了以下方法:
(local-project1)$ git checkout master
Switched to branch 'master'.
(master)$ git branch local-project1 -D
Deleted branch local-project1 (was 1111a11).
(master)$ git checkout -b local-project1
Switched to new branch 'local-project1'.
(local-project1)$ pwd
/c/workingcopies/solution
(local-project1)$ cd project1
(local-project1)$ pwd
/c/workingcopies/solution/project1
(local-project1)$ git branch --set-upstream local-project1 remotes/project1
Branch local-project1 set up to track local ref refs/remotes/project1.
(local-project1)$ git svn fetch
(local-project1)$ git reset --hard ae8e9b1a ;# go to last commit of the remote branch
提取从存储库中的分支获取最后一个修订,并将 HEAD 设置为最后一次提交,但我仍然只在分支中获得 project1,而不是解决方案。任何建议和帮助表示赞赏。