Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: List all files with assume-unchanged flag

Tags:

git

I need the assume-unchanged flag to avoid wrong commits of my project settings files. I do this via:

git update-index --assume-unchanged <file>

There is also a way to disable this with --no-assume-unchanged.

Now I added 5 files in this way and subsequently decided to add some of them again with the counter-flag.

Is there a way to list all these files declared as "assume-unchanged"?

Thanks a lot!

like image 225
John Rumpel Avatar asked Apr 24 '13 15:04

John Rumpel


2 Answers

You can use the lower-level command ls-files:

% git ls-files -v
h a.txt
H b.txt

If the first character is lowercase, it is marked as "assume unchanged", in this case a.txt. See also the man page of ls-files.

like image 87
robinst Avatar answered Oct 05 '22 11:10

robinst


According to the man page of git update-index :

To see which files have the "assume unchanged" bit set, use git ls-files -v.

And according to the man page of git ls-files :

-v

[...] use lowercase letters for files that are marked as assume unchanged

So in order to get all files marked as assumed unchanged use :

ls-files -v | egrep -r "^[a-z] .*"
like image 37
Ortomala Lokni Avatar answered Oct 05 '22 10:10

Ortomala Lokni