Git – prevent changes to file from being committed

I have a local file I need to be changed (an envvar for local environment detection) and don’t want it committed. Sure this is done elsewhere via say a local, silent import of a file outside of your repository.

In this case, it had to be in the the tracked file.

You can set certain things to be assumed as unchanged:

git update-index --assume-unchanged

Amazing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s