# Version control database config without exposing passwords

**URL:** <https://www.ruby-forum.com/t/version-control-database-config-without-exposing-passwords/174236>\
**Category:** Rails\
**Created:** [August 23, 2009, 4:35am UTC](https://www.ruby-forum.com/t/version-control-database-config-without-exposing-passwords/174236 "2009-08-23T04:35:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davetron5000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a3d4f5/32.png) [@davetron5000](https://www.ruby-forum.com/u/davetron5000)\
**Post date:** [August 23, 2009, 4:35am UTC](https://www.ruby-forum.com/t/version-control-database-config-without-exposing-passwords/174236/1 "2009-08-23T04:35:55Z")

</div>

I have a Rails app that I’m sharing via GitHub, but that I’m also  
using on my website. It has some configuration options that I don’t  
wish to share, but that I’d like version controlled. I’d also like to  
make it difficult or impossible for me to accidentally push these  
config changes up to GitHub.

What is the best practice or convention here?

The only option I could come up with (other than just not versioning  
these files), is to keep them on a private branch that I never push to  
GitHub.

Any other good ways to go about this?

Dave

---

<div class="post-metadata">

**Author:** ![davetron5000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a3d4f5/32.png) [@davetron5000](https://www.ruby-forum.com/u/davetron5000)\
**Post date:** [August 23, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/version-control-database-config-without-exposing-passwords/174236/2 "2009-08-23T12:58:05Z")

</div>

The couple projects that I’ve seen do this put a standard database.yml  
at database.yml.example (or similar) and keep their custom version  
elsewhere. You could .gitignore it and then symlink it in with  
Capistrano post-deploy, for instance.

–Matt J.
