Can I get a list of files marked --assume-unchanged?

What have I marked as --assume-unchanged? Is there any way to find out what I've tucked away using that option?

I've dug through the .git/ directory and don't see anything that looks like what I'd expect, but it must be somewhere. I've forgotten what I marked this way a few weeks ago and now I need to document those details for future developers.


You can use git ls-files -v. If the character printed is lower-case, the file is marked assume-unchanged.

To print just the files that are unchanged use:

git ls-files -v | grep '^[[:lower:]]'

To embrace your lazy programmer, turn this into a git alias. Edit your .gitconfig file to add this snippet:

[alias]
    ignored = !git ls-files -v | grep "^[[:lower:]]"

Now typing git ignored will give you output like this:

h path/to/ignored.file
h another/ignored.file

One Liner

git ls-files -v | grep "^[a-z]"

Use Aliases

IMHO, git hidden is better for files marked as --assume-unchanged:

git config --global alias.hidden '!git ls-files -v | grep "^[a-z]"'

Here's a list of related aliases I have in ~/.gitconfig:

[alias]
  hide = update-index --assume-unchanged
  unhide = update-index --no-assume-unchanged
  unhide-all = update-index --really-refresh
  hidden = !git ls-files -v | grep \"^[a-z]\"
  ignored = !git status -s --ignored | grep \"^!!\"

To make it work in subdirectories and support arguments:

  hidden = "!f(){ git -C \"$GIT_PREFIX\" ls-files -v \"$@\" | grep \"^[a-z]\";}; f"
  ignored = "!f(){ git -C \"$GIT_PREFIX\" status -s --ignored \"$@\" | grep \"^!!\";}; f"

For example:

 # cd target
 # git ignored classes

About File Status

For me most hidden files are marked with flag h, though there're actually several other flags according to the manual of git-ls-files-v:

-v
    Similar to -t, but use lowercase letters for files that are 
marked as assume unchanged (see git-update-index(1)).

About git ls-files-t:

This option (-t) identifies the file status with the following tags 
(followed by a space) at the start of each line:

H   cached
S   skip-worktree
M   unmerged
R   removed/deleted
C   modified/changed
K   to be killed
?   other

This command works more consistently for me. It will print only the files that are listed as 'assume-unchanged'.

git ls-files -v|grep "^h"

I've used this lots of times in different environments and it works perfectly.