I just tried using .gitattributes for the first time. I figure I must be doing something wrong because it is not working as I thought the purpose of using the merge=o
As mentioned in ".gitattributes & individual merge strategy for a file":
The merge driver is only called in non-trivial cases, i.e. if both master and test have touched setup (and you need to define the merge driver ours first).
You can see an example of concurrent modification (ie modification in both branches) in "How do I tell git to always select my local version for conflicted merges on a specific file?".
So if your merges didn't involve modifications of the same files within cache/
folder in both branches, your merge driver was never called.
But in your case, for files with different settings, I would recommend not using a merge driver, but a content filter driver, as in "Keep settings in branch"
That allows you to keep in version control:
cache/
folderEasy fix once I knew what I was doing: I missed adding the merge strategy with git config --global merge.ours.driver true
in my local environment.