Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While merging some of the files failed to merge.

git status

shows both the successful and failed merges.

How to view only the unsuccessful merge files(conflict).

Currently i am using the following command to do this

 find . -name '*.cpp' -o -name '*.h' | xargs grep -l '<<<<'
share|improve this question

2 Answers 2

up vote 14 down vote accepted
git diff

This will only show failed merges after an unsuccessful merge. It has many options to configure what information you want to see. I suspect this is the exact option you are after:

 git diff --name-status --diff-filter=U

Also see and

share|improve this answer
If you want a clean list of files without the preceding U, then you can call git diff --name-only --diff-filter=U. This way you can pipe the output, for example do git diff --name-only --diff-filter=U | xargs subl. – JHannes Oct 21 at 12:21

Try this:

$ git ls-files -u
see man-git-ls-files
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.