Skip to contentSkip to conversation

Question: How to list files that haven't been modified?

DISCUSSION Mark Burton 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

It's still early days for me and I haven't yet discovered how to ask git to list all the files in a tree that don't have pending modifications (staged or not). I have read about ls-files but it doesn't seem to offer that option. As far as I can tell, it can list the files known to git and the files that have been modified but not the difference between those sets.

Thanks,

Mark

#1 lore raw
Quoted 8 lines · Mark Burton

Hi,

It's still early days for me and I haven't yet discovered how to ask git to list all the files in a tree that don't have pending modifications (staged or not). I have read about ls-files but it doesn't seem to offer that option. As far as I can tell, it can list the files known to git and the files that have been modified but not the difference between those sets.

You could manually construct the difference between the lists:

$ comm -3 <(git ls-files) <(git ls-files --modified)