Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How to ignore a file from one repo and add it to another?

Tags:

git

heroku

I have a Ruby on Rails application that I am trying to host on Heroku. I would also like to use a GitHub public (free) repository to track changes. I need to check-in a file containing passwords to the Heroku remote repo, but ignore the file so I don't check it in to GitHub. Is there a way I can add the file to one repo, and ignore it from another?

Update: I figured out how to solve my immediate problem of storing passwords in Heroku by using Heroku Config vars. However, I'm still interested in the concept of pushing a file to only specified repos.

like image 791
Andrew Avatar asked Jul 13 '10 04:07

Andrew


1 Answers

As VonC mentioned, the best (and least error-prone) bet is to keep sensitive config info out of Git and put them in environment variables on your server. Here are instructions for how to do so on Heroku:

http://docs.heroku.com/config-vars

See also the linked questions.

like image 147
Aidan Feldman Avatar answered Sep 30 '22 00:09

Aidan Feldman