DEV Community

Discussion on: 15 Git Commands You May Not Know

Collapse
 
pshchelo profile image
Pavlo Shchelokovskyy

as alternative to 11. you can also use

git mergetool [-t <tool>]

when rebase fails with merge conflicts

The default merge tool to use is configurable in .gitconfig, mine is vimdiff :-)
For vimdiff it opens 4-pane view with two conflicting versions (REMOTE and LOCAL), their common ancestor (BASE) and the actual current file with merge conflicts. After resolving the conflict and exiting it will open the next file with conflicts, one by one.

Out of the box Git knows how to work with more diff/merge tools - emerge, gvimdiff, kdiff3, meld, vimdiff, and tortoisemerge, but you can configure other ones explicitly yourself.

And there's also a similar but simpler git difftool which is just a visual frontend to git diff

git-scm.com/docs/git-mergetool
git-scm.com/docs/git-difftool