开始追踪仅跟踪中继的git-svn回购分支/标签 [英] Start tracking branches/tags on a git-svn repo that was tracking only trunk
问题描述
我已经开始用git跟踪一个svn仓库,只克隆它的trunk目录。现在我想跟踪其他内容,但我不想再次克隆它,只是使用 - stdlayout
,因为它需要很长时间才能下载,而我已经有大部分代码在本地。
I've started tracking an svn repository with git by cloning only its trunk directory. Now I want to track the other stuff, but I don't want to have to clone it again just to use --stdlayout
since it takes a long time to download and I already have most of the code locally. How do I change the repository layout to match svn trunk/branches/tags scheme without having to clone again?
推荐答案
旧的 .git / config
:
[svn-remote "svn"]
url = svn://host/project/trunk
fetch = :refs/remotes/git-svn
$ b
新建 .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
正在跟踪已更改,所以 git-svn
必须重新生成所有内容。
No, it's not much different from doing a git svn clone
anew -- adding branches means that git
can see more merges which means the content git
is tracking has changed so git-svn
must regenerate everything.
这篇关于开始追踪仅跟踪中继的git-svn回购分支/标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!