2022-07-28 .jpeg photos
2022-07-27

Committing configuration files

So, the scenario here is that you have a configuration file that you want to be committed so that you have a complete example to work from. The problem is that the completed file might have passwords in it that you don’t want committed to your git repository.

I found the objectively correct answer today. You commit a file with the example first…

My example config.json file:

{
    "my_api_endpoint": "http://apis.kevinja.com/v1/fakeapi/",
    "api_username": "your_username",
    "api_password": "changeme"
}

Then… you do some git magic:

git update-index --skip-worktree config.json

This tells git that you don’t want it monitoring this file anymore.

Now, you can change the file to your heart’s content:

{
    "my_api_endpoint": "http://apis.kevinja.com/v1/fakeapi/",
    "api_username": "kevinja",
    "api_password": "My$uper$3cr1tPa$$w0rd"
}

…and git doesn’t care anymore.

➜  git status
On branch master
nothing to commit, working tree clean

You can always change your mind later:

git update-index --no-skip-worktree config.json
git geekery
2022-07-26 2022-07-26 photos
2022-02-17

Happy Snow Day

Snow day

Happy snow day, everybody. Unless you’re somewhere where you didn’t get snow today. Then, just happy day.

2020-06-20

Testing, Testing

This will be the first file to go up, if this whole git thing works out.

Hopefully, I’ll have more to say in the near future.