好吧,想象一下 当前.txt 文件:
asdf
base.txt 文件:
asdf
其他.txt 文件:
asdf
当我进行三向 merge 时
git merge-file current.txt base.txt other.txt
current.txt 文件变空,为什么? 在其他情况下,current.txt 文件将成为 3 个文件的 merge
最佳答案
这可能是 git merge-file
中的一个错误,但在实践中并不是每次都会触发。
git merge-file
不是面向最终用户使用的命令,而是由 git 在内部用作 merge 或 rebase 事件的一部分。它只会在实际发生更改的文件上调用,因此将三个具有相同内容的文件传递给 git merge-file 在实践中不会发生。
编辑:我已经提出了一个补丁来解决这个问题,尽管它需要专家审查:gmane link
编辑:此错误将在 v1.6.3.2 及更高版本的 git 中修复。
关于git - 如果 current = base = other,为什么 'git-merge-file current base other' 会创建一个空的 'current' 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/903966/