我正在使用 git-svn 来管理使用 git 的 Subversion 存储库。我通常在任何时候都有大量的 git 分支。
我经常需要更新它们以匹配存储库中的最新代码,但发现运行 git checkout <branch>; git svn rebase
很痛苦对于每个分支。
有没有比编写脚本(需要处理冲突)更简单的方法?
编辑:由于过程中最慢的部分是联系颠覆服务器并下载更新,所以运行 git svn rebase
会更快在一个分支上然后 git svn rebase --local
剩下的。
还有更好的方法吗?
最佳答案
我认为您的编辑有解决方案:
Since the slowest part of the process is contacting the subversion server and downloading the updates, it's faster to run git svn rebase on one branch and then git rebase git-svn on the rest.
我还为我的 git-svn 存储库使用了很多本地 git 分支,我发现自己每天都在对它们进行 rebase 操作,以使它们尽可能靠近远程分支。从我自己有限的经验来看,使用单个跟踪分支来跟踪远程分支,然后从中 rebase /merge 每个分支似乎是管理这种特定情况的最有效方法。
关于git - 如何在所有分支上运行 git svn rebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13607946/