Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all unchanged (tracked) files?

Tags:

git

git-status

I unzipped an older "git-image" onto my git repository and most of the files have been changed. I would like to know which files remained untouched. How to list these files?

like image 706
user3719454 Avatar asked Jul 16 '15 07:07

user3719454


1 Answers

I didn't find anything purely git, but with some bash it is possible:

( git ls-files --modified ; git ls-files ) | sort | uniq -u

explanation

  • git ls-files lists all files tracked by git
  • git ls-files --modified lists all the modified files tracked by git
  • the rest is some bash scripting to remove the duplicates from both lists.
like image 82
Chris Maes Avatar answered Oct 12 '22 01:10

Chris Maes