开始跟踪仅跟踪主干的git-svn仓库上的分支/标签

时间:2009-10-17 15:04:14

标签: svn git version-control git-svn

我已经开始使用git跟踪一个svn存储库,只通过克隆它的trunk目录。现在我想跟踪其他内容,但我不想再次克隆它只是为了使用--stdlayout,因为它需要很长时间才能下载并且我已经在本地拥有了大部分代码。如何更改存储库布局以匹配svn trunk / branches / tags方案而无需再次克隆?

1 个答案:

答案 0 :(得分:9)

.git/config

[svn-remote "svn"]
        url = svn://host/project/trunk
        fetch = :refs/remotes/git-svn

.git/config

[svn-remote "svn"]
        url = svn://host/project
        fetch = trunk:refs/remotes/git-svn
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*

现在运行git svn reset -r1 -p; git svn fetch; git svn rebase

不,与重新执行git svn clone没什么不同 - 添加分支意味着git可以看到更多合并,这意味着内容git正在跟踪已更改{{1必须重生一切。

相关问题