Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

Avoid checking in connection strings and other sensitive config information to Github December 21, 2010

Filed under: Git — Rupert Bates @ 12:25 pm

In order to avoid checking in connection strings and other sensitive configuration information to Github I use the following approach:

Check your config file in with blank or dummy values then run:

git update-index --assume-unchanged [fileName]

Git will then stop monitoring changes to that file allowing you to put the real config info into it without fear of checking it in.

If you later make changes that you DO want to check in you can run:

git update-index --no-assume-unchanged [fileName]

But obviously make sure you blank out the sensitive information before checking in, and re run the assume-unchanged command afterwards.

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