George Katsanos
George Katsanos

Reputation: 14175

Ignoring change to a file which is part of a git repository

I had to make a local modification of a file which is part of my git repo, but I don't to commit that file, or lose my modification. I don't want to have to git add -p every time either. I added the file to my gitignore but this didn't work.

Upvotes: 1

Views: 28

Answers (1)

Master Slave
Master Slave

Reputation: 28519

You can do

git update-index --assume-unchanged [the path to your file]

you can reverse the operation at any point by calling

git update-index --no-assume-unchanged [the path to your file]

Upvotes: 2

Related Questions