3

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?

asked Apr 5, 2014 at 22:35

2 Answers 2

6

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.

answered Apr 5, 2014 at 22:39
Sign up to request clarification or add additional context in comments.

Comments

3

One possible approach is:

  1. fill the config file with dummy data, commit changes and push to GitHub
  2. configure git to ignore changes in tracked file:

    git update-index --assume-unchanged config-file

  3. fill the config file with sensitive information
answered Apr 5, 2014 at 22:56

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.