当我第一次尝试合并时会发生冲突时,我会以非常有用和可读的格式获得输出:
CONFLICT (rename/delete): Folder/Folder/file.txt deleted in branch_to_merge and renamed in HEAD. Version HEAD of Folder/Folder/file.txt left in tree.
CONFLICT (content): Merge conflict in Folder/Folder/file2.txt
但是,当我之后运行git status
或git ls-files -u
时,它会以其他格式显示合并状态,我个人觉得这种格式不太有用。
我可以在不重新启动合并过程的情况下再次获得该输出吗?
答案 0 :(得分:0)
这是你在找什么?
git diff --name-only --diff-filter=U
我一直在使用各种冲突案件。例如,当一个cherry-pick因config.js中的冲突而失败时,我运行它并得到以下输出:
> git cherry-pick xxxxxxx..yyyyyyy
error: could not apply xxxxxxx... implement feature mmm
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
> git diff --name-only --diff-filter=U
config/config.js
顺便说一下,我已在conflict
中为其设置了别名~/.gitconfig
:
[alias]
conflict = diff --name-only --diff-filter=U