Dienstag, 19. März 2019

How To Resolve GIT Merge Conflicts with IntelliJ

Resolve a Merge Conflict in GIT with IntelliJ


Let us assume you are using Bitbucket or a similar tool to administrate and host your GIT repositories.
You are using the Open Source principle with Pull Request, Review, Merge: 
  • Push changes
  • Assign a reviewer or two
  • Depending on your team agreement, either you or the reviewer will merge the feature onto your main develop branch (I will call it "develop"). The pull request is merged.

In some cases there will be incompatible changes which happened on the develop branch when you are about to merge.
The pull request cannot be merged due to merge conflicts with your develop branch.

1) Checkout the current develop branch from remote locally.
2) Checkout the feature branch locally
3) When you have switched to your feature branch, use this command:
$git merge develop
4) The merge conflicts are now shown.
5) Use IntelliiJ Merge Tool to resolve the merge conflicts: https://www.jetbrains.com/help/idea/resolving-conflicts.html
Note: there is also the standard GIT merge-tool which will work as a stand-alone without an IDE.
6) Push everything to your remote feature branch
7) Merge the pull request via Bitbucket or other tool.

Keine Kommentare:

Kommentar veröffentlichen

NEW BLOG! http://cleancode.consulting/

Dear Reader, This Blog is closed and remains as an archive. Please find our new Blog at  http://cleancode.consulting/