我在 Visual Studio 中使用 Git,突然在所有文件上都发生了冲突
我可以单击每个冲突并选择 Take Source,但由于有 534 个冲突,我宁愿在命令行上进行批量解决。解决所有这些冲突的适当命令是什么?
最佳答案
检查 Visual Studio 报告的冲突之间的差异。
它们可能仅与 eol 风格有关(行尾 LF 与 CRLF)
您可以尝试设置 git config core.autocrlf true/false
以查看最佳效果,但此 Q/A 页面确实提到 Git plugin doesn't seem to respect that setting anyway .
OP Eivind Gussiås Løkseth添加 in the comments :
I'm looking for a command to do that for all conflicts in one operation, because doing it for all 500 conflicts would take a lot of time
如“Simple tool to 'accept theirs' or 'accept mine' on a whole file using git”中所述,您可以在存储库的根文件夹中执行以下操作:
git checkout HEAD -- .
关于Git merge 与在本地和源上添加的 500 个文件发生冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24091655/