djondal djondal - 1 year ago 87
Git Question

With git, temporary exclude a changed tracked file from commit in command line

I have a tracked database (already added) file in git. I want this file to always contain the same data in my git repository. Even when I modify it in the working copy (local sandbox) for test purposes.

With git, how to exclude this changed file on my working copy from a commit ?

Answer Source

The way to ignore certain files that are already committed is

git update-index --assume-unchanged file

However, this is a local setting, and it doesn't propagate when cloning.

Its effect is canceled with git update-index --no-assume-unchanged gui.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download