3

I temporarily wanted to get rid of some files for a certain commit and ran: git update-index --assume-unchanged file_name on a bunch of files.

Then I closed my terminal, is there anyway of getting back the names of files that I ran the git update-index command on so that I can run the --not-assume-unchanged on them?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Jamal Khan
  • 9,371
  • 6
  • 23
  • 23
  • I don't know the answer, however next time use the staging area instead, it's more usable and specially designed for this use. `update-index` is plumbing and difficult to use for non-gurus – CharlesB Sep 17 '12 at 19:58
  • Looks like this question has already been answered [here](http://stackoverflow.com/questions/2363197/can-i-get-a-list-of-files-marked-assume-unchanged). – mkobit May 31 '13 at 21:07

3 Answers3

5

to further extend Richard Michael's answer, you can simply grep for a lowercase letter at the beginning of the line of the ls-files -v output

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

will show you just your assumed-unchanged files

atreat
  • 4,243
  • 1
  • 30
  • 34
3

Just run it on all the files in your tree. The default is to not assume unchanged.

Why did you run it in the first place? If you want to exclude files from a commit, just git add the files you want manually and run git commit. You only get all modified files if you pass the -a flag to git commit, so just don't do that.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
3

Note, I am using git --version 1.8.1.2.

You may determine the bits set for files in the index with: git ls-files -v. Files with assume-unchanged bit set have lowercase tags.

Do not confuse this with the tag S, which corresponds to the skip-worktree bit (which would appear as s if the file also had the assume-unchanged bit set).

See git help update-index and the discussion about the tags themselves in the -t and -v option sections.

For example: Gemfile has skip-worktree set, we'll also set assume-unchanged.

$ git ls-files -v|grep Gemfile
S Gemfile
$ git update-index --assume-unchanged Gemfile
$ git ls-files -v|grep Gemfile
s Gemfile
Richard Michael
  • 1,540
  • 16
  • 19