How to merge Git with a GUI on Ubuntu

Here i want to show how to resolve conflicts while merging git branches. It is not the only method but one of.

Let's use Meld for this task:

First install it:

$ sudo add-apt-repository ppa:tsvetko.tsvetkov/trusty-backports

$ sudo apt-get update

$ sudo apt-get install meld

And use:

$ git mergetool -t meld

If you have conflict, you will see something like this:

Three windows are shown, and left to right are:

  • The local branch (master branch)
  • The current version that you are merging into (final solution)
  • The “remote” version (from the other branch)

To choose the text from the desired brunch, click on the black arrow, showing direction. Meld copies the text to the other file, and removes the text from where it was). In the end you have to save file and resolve conflict in Git.

Configure Git For Your Mergetool Of Choice

There are many merge tools available and everybody has their own favorites.

To configure git to remember which merge tool you want, type git config –global merge.tool [tool]. For meld use:

$ git config --global merge.tool meld

results matching ""

    No results matching ""