Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

Is there anything simpler than:

git ls-files -u  | cut -f 2 | sort -u

or:

git ls-files -u  | awk '{print $4}' | sort | uniq

I guess I could set up a handy alias for that, however, I was wondering how pros do it. I'd use it to write shell loops e.g. to auto-resolve conflict, etc. Maybe replace that loop by plugging into mergetool.cmd?

1 Answer

0 votes
by (50.2k points)

There is a command which helps to find the simplest way to list conflicted files in git then you use:

git diff --name-only --diff-filter=U

This will list the conflicted file in git.

Refer: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---name-only

Browse Categories

...