I want to ignore my project version file from auto-merge in Bitbucket Server as this file is always going to be different for different branches. For this, I have created a merge driver similar to the below in repository's .gitconfig
[merge "ours"]
driver = true
I have added .gitattribute file at the root of the repository with the below content (to ignore this file for the merge):
version.txt merge=ours
However, Bitbucket Server, doesn't seem to use the .gitconfig settings in my repo and it always conflicts on this file. How can I configure bitbucket server to read and apply the my settings in .gitconfig?
I think you should refactor your build completely. Why aren't you just versioning your master branch. Are your sub branches really versioned? You could create a git hook for tagging branches where you simple write a bash command writing the version to your version.txt file