svn - git-svn merge 2 个 svn 分支

标签 svn git merge git-svn

我正在使用 svn。我有两个分支,并且对它们都进行了很多更改。 除了其中一个分支之外,很多文件都被重命名了,所以现在 svn 无法帮助我 merge 这些文件中的更改(众所周知的 svn 限制)。

  1. 是否可以使用 git-svn 来执行分支的 merge ?
  2. 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/

相关文章:

visual-studio - 升级一个非常旧的 SVN 存储库

ios - 将 Head 版本从 http 获取到 bundle 版本

git - brew 更新 : The following untracked working tree files would be overwritten by merge:

linux - git 推送错误 : could not read Username for 'https://github.com' : Permission denied

r - 在R中非常大的数据集中,将2列多次组合成1列

svn - Mercurial 如何处理组件或模块化开发?

svn - Subversion 与 SourceSafe 中的性能

git - 通过 "--push-option="中的 "git push"发送多个选项

java - 使用 apache POI 按值合并动态单元格

r - 合并 2 个具有不同列名的数据框