Denis Barushev


Using Kompare for Git Diffs


It’s possible to use kompare as a graphical diff viewer for git. I created file git-kompare in my /usr/local/bin/ directory with such content:

git diff $* | kompare -

I also created alias gk for this command in my ~.bashrc:

alias gk='git-kompare'

Now I can use gk command instead of git diff with all its options.

Update from Sean Blanton:

You can shorten this with a bash function:

gk () { git diff $* | kompare - ; }

Bash functions can handle the pipes and arguments better than aliases.