简体   繁体   English

如何将新的 SVN 远程分支添加到现有的 git-svn 存储库

[英]How do I add new SVN remote branch to the existing git-svn repository

I have cloned SVN repository using git-svn and hand-picked some of branches.我已经使用 git-svn 克隆了 SVN 存储库并手工挑选了一些分支。 Now I need to add one more branch from SVN to Git.现在我需要再从 SVN 添加一个分支到 Git。 Can this be done?这能做到吗? I Updated the .git/config file to add it but git svn fetch does nothing.我更新了 .git/config 文件以添加它,但git svn fetch什么也不做。

We have huge repository with non-standard layout and moving everything would not be great.我们有非标准布局的巨大存储库,移动一切都不是很好。 So I am hoping to move only stuff I know we immediately need at the cost of some history loss (still keeping years of work).所以我希望只移动我知道我们立即需要的东西,代价是损失一些历史(仍然保持多年的工作)。 I am worried though that at some point patch for some historical release will be needed and we will not be able to add the missing branch from read-only SVN...我担心在某些时候需要一些历史版本的补丁,我们将无法从只读 SVN 添加丢失的分支......

You are talking about an old branch, aren't you?你说的是一个旧的分支,不是吗? It can be done, modify the configuration (as I think you have already done) and then you have to fetch and use -r specifying the revision where the branch was created.可以完成,修改配置(我认为您已经完成了),然后您必须获取并使用-r指定创建分支的修订版。

git svn fetch -r revision-where-it-was-created:HEAD

That should do那应该做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM