Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

So I'm fine with the source code to my files being public, but I obviously don't want my passwords/login info/etc to be public.

How can I host the repo with GitHub publicly but keep myself safe?

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

Generally, all config data like passwords and database info will be kept in a config file. To keep private data safe, I usually:

  • Create an example config file that is hosted with the project
  • Provide documentation on modifying the example to be the actual config (rename the file, replace variables, etc.)
  • Add the actual config file to .gitignore so that it is not a tracked file

Those are my thoughts ...

share|improve this answer
add comment

You have at least two ways:

  • Don't use Git, here such obvious task is problem, and move to Mercurial with MQ, in which you store in public place any scrap, replaced in local workplace by actual data (local MQ-patches)
  • Read about smudge/clean filters and store in repository template-snippets, expanded automagicaly to real data in Working Directory
share|improve this answer
1  
If the question implies using git, the not using git isn't an answer. –  Steve Robbins Dec 12 '12 at 17:48
    
@SteveRobbins - I wrote "You have at least two ways...", BTW. Templating and handwork is old style, filters - Git-way, JFYI –  Lazy Badger Dec 12 '12 at 19:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.