Reputation: 21
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?
Upvotes: 2
Views: 1766
Reputation: 62864
I had the same problem recently and the only workaround that Atlassian currently suggest is the following:
git config --global merge.ours.driver true
This will activate your custom merge strategy and the next time you create a pull request that has a conflict on the version.txt
file, it will be automatically resolved, by applying the "ours"
(destination branch) state.
Upvotes: 1
Reputation: 304
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
Upvotes: 0