tags:

views:

163

answers:

1

Hi,

I finally made a great step by abandoning SVN for Git and loving it. It must be somewhere, but I can't really find on how to do this, gitosis friendly.

I have my repo 'site' stored on a remote machine. I push my working copy and pull this data on a production machine. One mayor difference though is 'one' file: database.yml, which will never change on the production machine.

Is it possible (and if so, how), when the data is pulled from the repo, to "ignore" only this file? I am doing this manually at this point, but some elegance would be most appreciated.

Thanks.

+5  A: 

My advice: don't even put it into git. Make a database.yml.skel or something like that, so that a user can model their own database.yml with that in mind as a sample; but in my opinion, conf file does not belong in version control - exactly for the reason you mention.

Ignoring is very easy: in fact, there are several ways to do it. The correct for this one is .gitignore file; another one is .git/info/excludes. See this answer for details.

So, off the top of my head:

echo database.yml > config/.gitignore
git add config/.gitignore
git commit
Amadan
or put config/database.yml in .gitignore
shingara