I am using Sourcetree 3.0.12 on Windows. The command-line git version I'm using is git version 2.18.0.windows.1
(at least that's what it says when I open the Terminal from Sourcetree and get the Cygwin command line).
I want all the files on app/Resources/
in my tree to be "protected" from changes in other branches; in other words, I want git to always merge my version in that folder. So I did the following:
1) In the command line, at the root of the tree, I typed git config --global merge.ours.driver true
.
2) At the root of my tree I created a .gitattributes
file that said:
app/Resources/ merge=ours
Then I try to merge a change in another branch... and I get a lot of conflicts in files in app/Resources
.
I read around an offhand comment suggesting that this feature only works with a newer version of git. Is that the case, or did I do something wrong?
EDIT: following the first answer below, I edited by hand my .git/config
file to add this:
[merge "ours"]
name = ours
driver = true
I added it at the end of the file, then I tried merging again... but didn't work either.