I tried to add a merge strategy to my .gitattributes file in my repository. But when I merge another branch with that (different) file it results in a merge-conflict - auto merge failed.
Here's what I try to do.
.gitattributes:
backend/library/project/config.php merge=ours
Branches:
in production I have config.php'A and in staging I have config.php'B.
> git checkout production
> git merge staging
> Auto-merging backend/library/project/config.php
> CONFLICT (content): Merge conflict in backend/library/project/config.php
> Automatic merge failed; fix conflicts and then commit the result.
I tried adding the line to .git/info/attributes as well as adding quotes to ..merge="ours".
Has anybody an idea what I am doing wrong? (Git-version is 1.7.4.4) thx
There are two excellent Stack Overflow responses which address this problem:
How do I tell git to always select my local version for conflicted merges on a specific file?
and
.gitattributes & individual merge strategy for a file
I'd suggest reading through the top answer in the first link. It's long, but very detailed and informative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With