I have a master and a test branch of my (web) application. These projects are almost the same, except for one file which sets up the application, say "setup".
Whenever I merge one branch into the other, I would like that branch to keep its version of setup. That is, git should not attempt to merge the changes to that file.
I followed the guidance from the Pro Git book and created a .gitattributes file, with the line "setup merge=ours". However, this does not work - neither with fast forward merges not if I introduce conflicts.
(To be precise:
$: mkdir gitest
$: cd gittest
$: git init
$: echo "setup merge=ours" >> .gitattributes
$: echo "master" >> setup
$: git add setup .gitattributes
$: git commit -a -m ...
$: git branch test
$: git checkout test
$: echo "test" >> setup
$: git commit -a -m ...
$: git checkout master
$: git merge test
Expected result: setup contains the word "master", instead git performs a ff merge and setup is "test'.)