I have the following directory structure:
project/ .git/ ... app/ ... config/ initializers/ braintree.rb environments/ production.rb .gitattributes
My project uses two main branches, a master and a production, each of which tracks various remote (production and internship heroku applications).
The idea is that the intermediate branch moves forward with new functions, they are pressed and tested on the intermediate console, then the wizard is quickly redirected to match the setting and pressing the production console.
Here I want: to freely combine these two branches, while maintaining their versions of braintree.rb and production.rb .
To accomplish this, here is what I introduced in .gitattributes (according to ProGit book):
config/initializers/braintree.rb merge=ours config/environments/production.rb merge=ours
The file is present in both branches.
The problem I am facing is that this in no way affects anything. Whenever I merge between them, the files change anyway, and I have to change them again.
I have the feeling that I'm missing something terribly obvious, but for now it eludes me. I know that the other answers here are related to the creation of custom merge drivers, but the ProGit book does not mention this process and seems to imply that our driver is built-in (and I saw that it is mentioned in the man pages, so I sure that it is). The only thing I can think of is that I somehow put .gitattributes in the wrong place or messed up its contents, but I can not find much information about this. I tried moving it to the same directory as the files, but to no avail.
In case of any help, I am running git version 1.7.2 on OS X. Any help would be greatly appreciated.