{"thread":{"id":"19740","subject":"git use pattern questions","startedAt":"2009-06-08T09:06:50Z","lastAt":"2009-06-08T12:29:29Z","messageCount":2,"participants":["Alex K","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115786","messageId":"e4a904790906080206t51ee260ve64304d8c1147ebc@mail.gmail.com","threadId":"19740","inReplyTo":null,"subject":"git use pattern questions","fromName":"Alex K","fromEmail":"spaceoutlet@gmail.com","sentAt":"2009-06-08T09:06:50Z","receivedAt":"2009-06-08T09:06:50Z","isPatch":false,"sender":{"key":"spaceoutlet@gmail.com","avatar":null},"body":"Hello\n\nI would like to publish a repository on say github but I would still\nlike to hide sensitive information from a config file which\nnevertheless needs to be part of the repo. If it was possible to\npublish a single branch then I'd make one especially for github and\npublish the config file with something like \"your password here\"...\n\nWould you know what's the best pattern to publish a repository but\nstill hide sensitive information such as values of passwords, mysq\nport etc..?\n\nAlso I have a developpement version of the site and a production\nversion on another server. Is making a branch for the production\nversion a good choice? I used to simply rsync the changes from dev to\nprod and make the changes in the config file for the production\nversion. This makes sense because in order for the site to run a mysql\ndump and some other data not part of the repo needs to be synced.\n\nThank you,\n\nAlex\n"},{"id":"115800","messageId":"20090608122929.GE13775@coredump.intra.peff.net","threadId":"19740","inReplyTo":"e4a904790906080206t51ee260ve64304d8c1147ebc@mail.gmail.com","subject":"Re: git use pattern questions","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-06-08T12:29:29Z","receivedAt":"2009-06-08T12:29:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 08, 2009 at 10:06:50AM +0100, Alex K wrote:\n\n> I would like to publish a repository on say github but I would still\n> like to hide sensitive information from a config file which\n> nevertheless needs to be part of the repo. If it was possible to\n> publish a single branch then I'd make one especially for github and\n> publish the config file with something like \"your password here\"...\n> \n> Would you know what's the best pattern to publish a repository but\n> still hide sensitive information such as values of passwords, mysq\n> port etc..?\n\nThat is not really possible with git. If you publish a branch, all of\nits contents will be visible to anyone who clones it. You _could_ keep a\npristine branch without any config, do your development there, and then\nmerge it to a branch with the secret config file in it. And then just\npublish the development branch. I suspect that would become a pain in\nthe long run, as you would need to commit and merge in order to do a\ntest.\n\nGenerally, I think the strategy people use is not to put the config file\ninto git at all. Put in a sample for people to read, but keep your\npersonal one as a purely local thing. You will then have to deal with\ndeployment of the tracked files and the config file separately (but\nusually people don't deploy directly using git; they use \"make install\"\nor rsync or whatever from their git checkout).\n\n-Peff\n"}]}