我只需要一个简单的冲突文件列表。
有什么比:
更简单的吗?git ls-files -u | cut -f 2 | sort -u
或:
git ls-files -u | awk '{print $4}' | sort | uniq
我想我可以为此设置一个方便的别名
,但我想知道专业人士是如何做到的。我会用它来编写 shell 循环,例如自动解决冲突等。也许通过插入 mergetool.cmd
来替换那个循环?
最佳答案
使用 git diff,使用 name-only只显示名字,diff-filter=U仅包含“未 merge ”文件(可选,relative 以显示相对于当前工作目录的路径)。
git diff --name-only --diff-filter=U --relative
关于git - 在 Git 中列出冲突文件的最简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3065650/