1

I have a few changes which I don't want to commit and yet I want to retain them locally. Problem is that I use git (with git status), they keep appearing in the list of uncommitted changes. I want to ask git to ignore such changes and yet retain them locally.

I can't discard them since I want the changes to be retained locally.

edi9999
  • 19,701
  • 13
  • 88
  • 127
Pratik Patel
  • 1,305
  • 1
  • 17
  • 44
  • 1
    possible duplicate of [Git: Ignore tracked files](http://stackoverflow.com/questions/10755655/git-ignore-tracked-files) – AD7six Jun 02 '14 at 15:57

1 Answers1

1

I dont know, how you can ignore exactly specific changes. But you can ignore changes in tracking files. And when you want to commit some another changes, you can make file unignored, commit necessary changes and make other file changes ignored again.

You can do it by using git update-index --assume_unchanged <file> (see documentation)

To start tracking changes again use git update-index --no-assume_unchanged <file>

To show ignoring files use git ls-files -v

Ovsyanka
  • 399
  • 3
  • 11
  • This has changed to `git update-index --[no-]assume-unchanged` as of git 2.9 I believe. – cs95 Apr 16 '17 at 19:55