Is there a way to avoid merge conflicts in version tag in pom.xml
when merging master into a branch? I have quite a few pom files, 80, and all of them have same version which is different from one in master. It's laborious and time-consuming to execute git mergetool
for 80 pom files just for a version tag.
You can only resolve merge conflicts on GitHub that are caused by competing line changes, such as when people make different changes to the same line of the same file on different branches in your Git repository. For all other types of merge conflicts, you must resolve the conflict locally on the command line.
We can manually resolve the merge conflict by editing the content in the bottom pane, and then saving the file using :wqa (Write and Quit all files). Once the conflict resolution is successful, the merged file will be staged for commit. git commit -m 'Merged from multiple branches' .
What I always do is change the version of the modules using the maven versions plugin, before merging from another branch (with a different version):
mvn versions:set -DnewVersion=1.1 -DgenerateBackupPoms=false
That'll change the version of all the current modules (parent and children) to the one you specify as the newVersion parameter. After changing the version, make a new commit (git commit...) and then do the merge. I've got all of this automated using a Jenkins task, but it shouldn't be difficult to implement it in other ways (e.g. sh script).
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