Git merge 与在本地和源上添加的 500 个文件发生冲突

标签 git visual-studio git-merge

我在 Visual Studio 中使用 Git,突然在所有文件上都发生了冲突 screenshot

我可以单击每个冲突并选择 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/

相关文章:

git - 从 git 提交中提取树 sha1

git - 通过覆盖 "CI detected, skipping Git hooks installation"在 Jenkins 管道作业中安装 husky git hooks

c# - 无法在 git 中进行推/pull - 使用 visual studio

git - C# 项目中的所有文件是否都需要置于版本控制之下?

c# - 如何在没有项目文件的情况下运行 C# 项目?

github - 如何在 GitHub 上进行快进合并?

c# - 用于 Visual Studio 项目的独立构建系统

c++ - int 到 unsigned char* 反之亦然

git - 如何将推送恢复到主分支,然后再次从新分支推送相同的更改?

git-merge-base 只返回一个提交