我正在使用 svn。我有两个分支,并且对它们都进行了很多更改。 除了其中一个分支之外,很多文件都被重命名了,所以现在 svn 无法帮助我 merge 这些文件中的更改(众所周知的 svn 限制)。
- 是否可以使用 git-svn 来执行分支的 merge ?
- git-svn 也会处理重命名的文件吗?
谢谢
最佳答案
git merge
应该能够检测(到一定程度)重命名。
recursive
This can only resolve two heads using a 3-way merge algorithm.
Additionally this can detect and handle merges involving renames.
This is the default merge strategy when pulling or merging one branch.
但是git-svn
只能从SVN导入/导出,不能 merge 。
merge 很棘手:
CAVEATS
For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all
git svn
users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches.
The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit'ing to the SVN repository.Running git merge or git pull is NOT recommended on a branch you plan to dcommit from. Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you've made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch.
If you do merge, note the following rule: git svn dcommit will attempt to commit on top of the SVN commit named in
git log --grep=^git-svn-id: --first-parent -1
You must therefore ensure that the most recent commit of the branch you want to dcommit to is the first parent of the merge. Chaos will ensue otherwise, especially if the first parent is an older commit on the same SVN branch.
关于svn - git-svn merge 2 个 svn 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2693771/