SVN中维护分支的工具
我的团队使用 SVN 进行源代码控制。最近,我一直在开发一个分支,偶尔会从主干进行合并,这是一次相当烦人的经历(参见 Joel Spolsky 的 “Subversion Story #1”),所以我一直在寻找管理分支和合并的替代方法。鉴于集中式 SVN 存储库是不可协商的,我想要的是一组满足以下条件的工具。
主干和分支的完整修订历史记录应存储在 SVN 中。
向任一方向(以及可能交叉)进行合并应该相对轻松。
合并历史记录应最大程度地存储在 SVN 中。
我查看了 git-svn 和 bzr-svn ,但似乎都无法胜任这项工作——基本上,考虑到它们可以从 SVN 存储库导出的修订历史记录,他们似乎无法比 SVN 更好地处理合并工作。例如,在使用 git 克隆存储库后,我的分支的修订历史记录显示了主干上的原始分支,但 git 没有“看到”任何临时分支SVN 合并为“本机”合并——修订历史记录是一长行。因此,任何从 git
中从 trunk 进行合并的尝试都会产生与 SVN 合并一样多的冲突。 (此外,git-svn
文档明确警告不要使用git
在分支之间合并。)
有没有办法调整我的工作流程以使 git
满足上述要求?也许我只需要提示或技巧(或单独的合并工具?)来帮助 SVN 更好地合并到分支中?
My team uses SVN for source control. Recently, I've been working on a branch with occasional merges from the trunk and it's been a fairly annoying experience (cf. Joel Spolsky's "Subversion Story #1"), so I've been looking alternative ways to manage branches and merging. Given that a centralized SVN repository is non-negotiable, what I'd like is a set of tools that satisfy the following conditions.
Complete revision history should be stored in SVN for both trunk and branches.
Merging in either direction (and potentially criss-crossing) should be relatively painless.
Merging history should be stored in SVN to the greatest extent possible.
I've looked at both git-svn
and bzr-svn
and neither seems to be up to the job—basically, given the revision history they can export from the SVN repository, they can't seem to do any better a job handling merges than SVN can. For example, after cloning the repository with git
, the revision history for my branch shows the original branch off of trunk, but git
doesn't "see" any of the interim SVN merges as "native" merges—the revision history is one long line. As a result, any attempts to merge from trunk in git
yield just as many conflicts as an SVN merge would. (Besides, the git-svn
documentation explicitly warns against using git
to merge between branches.)
Is there a way to adjust my workflow to make git
satisfy the above requirements? Maybe I just need tips or tricks (or a separate merging tool?) to help SVN be better at merging into branches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有纯粹的 SVN 答案,我想参考 SO 问题“如何欺骗 git-svn 来识别用 svn 进行的合并?"
我建议在一个特殊的分支中进行这些 git 合并,但一个更简单的解决方案是记录(至少最新)SVN 合并到
git-svn
克隆存储库中 git 嫁接文件,以便将: 转换为:
,在 dcommit 并将其发送回 SVN 之前简化 git 合并过程。
Without having a pure SVN answer, I would like to refer to the SO question "How to fool git-svn to recognize merges made with svn?"
I recommended doing those git merges in a special branch, but a simpler solution would be to record (at least the most recent) SVN merges in the
git-svn
cloned repo with git grafts file, in order to transform:into:
, easing the git merge process, before dcommit and sending that back to SVN.