Reputation: 1511
Assume I have a project I'm working on that is a blog. In this blog I have a config file with sensitive information in it. When I decide to push this project to Github, I want the config file filled with example data instead of my sensitive data. What is the best, and most widely used, method of achieving this?
Upvotes: 3
Views: 603
Reputation: 333
One possible approach is:
configure git to ignore changes in tracked file:
git update-index --assume-unchanged config-file
Upvotes: 3
Reputation: 239781
Don't put it there in the first place. Check in an example config file with a different name, add the real config file's name to .gitignore
, and never check it in.
If you've already done commits with your config file in place, use git filter-branch
to make it go away before you push anywhere public.
Upvotes: 6