Question

Basically I am searching for the git equivalent to hg status -c:

-c --clean show only files without changes

Calling git status lists by default all 'dirty' files (i.e. files with changes) and untracked ones - which is fine.

But sometimes I need to display the complement - all (tracked) files without changes.

How do I accomplish this with git?

Was it helpful?

Solution 2

$ git ls-files -t | grep '^H'

The man page states that -t is deprecated - but I didn't find a better way. The alternatives the man page mentions does not seem to be sufficient for this problem.

OTHER TIPS

this should do the trick:

$ git ls-files -m  > /dev/shm/exclude && git ls-files | grep -v -x -f /dev/shm/exclude

Remember to delete the temporary file afterwards!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top