我有*.csproj merge=union
,.gitattributes
我很高兴 git 如何管理与它的合并。但在其他时候,git 合并 xml 文件的工作会做得很差,例如*.csproj
(因为我听说缺少适当的 xml 合并驱动程序)并且我无法再加载 VS 项目。
所以我git reset --hard HEAD^
再试一次,git merge --no-commit --no-ff
这样我就可以在提交合并之前偷偷摸摸。
例如:
mkdir foobar && cd foobar
git init
echo "README merge=union" > .gitattributes
echo "Hello" > README
git add --all
git commit -m 'Initial commit.'
git checkout -b italian-translation
echo "Ciao" > README
git commit -am 'Italian translation'
git checkout master
git merge --no-commit --no-ff italian-translation
此时README
包含:
Hello
Ciao
然后我尝试查看 的冲突版本README
,因此我可以深入了解冲突并手动解决:
git checkout -m README
我期待类似的东西:
<<<
Hello
===
Ciao
>>>
但我仍然得到:
Hello
Ciao
请问我在这里缺少什么?
谢谢你。