9

git diff ... shows a difference but in the terminal.

I want a GUI for visualization of git diff ....

Insofar I tried git diff ... | kompare -. This does the trick but the context shown is only what is available from the .diff, not full file content.

It probably would be better to be able to see full file content in the diff visualizer.

I can check out a Git repository twice, export twice, and compare with a GUI diff tool (such as Kompare). But it is cumbersome. Do you know a better way to do it? At last, I could try a shell script which does two checkouts and two exports to a temporary directory, but this is not the best possible solution.

  • 1
    Do you want to compare between HEAD and your locally modified clone? Or between any two versions, possibly remote? – Nicolas Raoul Mar 8 '16 at 9:45
  • @NicolasRaoul I want to compare between any two versions. No necessity for remote – porton Mar 8 '16 at 15:08
  • 2
    if you want a GUI tool, run git difftool --help and see the supported list – phuclv Jun 27 '18 at 15:36
6

Git itself ships with gitk to browse the repository (which includes showing diffs of stuff you've already committed) , gitgui and git difftool [which allows you to choose one of the merge tools present in your system]. What I personally use is Gitcola, which I find quite convenient:

Gitcola
Gitcola (source: Gitcola; click image to enlarge)

It not only handles the diff part, but also most other actions you need in your daily workflow (commit, push, pull, create tags, etc.).

For alternatives, you might wish to take a look at 6 Useful Graphical Git Client for Linux

Also note that, if you're not satisfied with the built-in diff tool, you always can configure an external one. A very good candidate for that would be Meld – which usually is available right from the standard repositories on most distributions:

Meld Mary
Meld (source: Meld)

Note that such an external diff tool doesn't need to know about Git, as interfacing with the repository is covered by Git Cola and the diff tool just has to, well, visualize the diff handed to it by Git Cola.

| improve this answer | |
  • I believe gitk only shows a graphical representation of the branch trees, and while that's very useful, the diffs it shows look pretty much the same as on the command line. Am I missing something? – Michael Scheper Jun 25 '18 at 18:48
  • @MichaelScheper the colors? Or the fact that gitk was just the cliff-hanger, and my answer rather recommends Gitcola? :) – Izzy Jun 25 '18 at 19:19
  • Hee! ☺ I do see colours when I do git diff at the command line, so Gitcola doesn't really offer a benefit for me. But maybe not everyone's terminal allows colour, especially Windows users, so yes, I see, it is a step forward. But I suppose I understood 'a graphical representation' to mean the kind of side-by-side, differing-length-scrollable output that SmartGit, in @Tom's answer, provides, as well as various IDEs. But thanks for the clarification, and the thrill of the cliff-hanger. 😉 – Michael Scheper Jun 26 '18 at 14:05
  • Wll, if you don't like the built-in diff tool @MichaelScheper – you can always configure an external one like e.g. Meld. That doesn't need to know git then, as Git Cola itself takes care for that end it simply needs to visualize the diff. Guess meld would perfectly fit your wishes, see e.g. this screenshot. There, updated my answer. Happier? :) – Izzy Jun 26 '18 at 17:32
  • Yep, that's the one that I was hoping for. TBH, I normally use the command line and vimdiff, but for more complicated changes, tools like Meld and SmartGit do make life easier. Thanks! – Michael Scheper Jun 26 '18 at 21:39
2

I would check out SmartGit, it should do everything you want. It's available on not only on Linux but Windows and Macs as well. It's pretty easy to use and is free for non-commercial projects.

SmartGit (free*)

SmartGit is a front-end for the distributed version control system Git and runs on Windows, Mac OS X and Linux. SmartGit is intended for developers who prefer a graphical user interface over a command line client, to be even more productive with Git — the most powerful DVCS today.

SmartGit UI

* For non-commercial work

| improve this answer | |
0

New answer to an old question but I'm compelled. Another excellent option is GitLens

Yesterday found myself leaving another IDE's VCS and installing vscodium to use GitLens instead. The way that it contextually moves to the file you've open in the editor, and presents a deep commit history is pure brilliant convienience.

https://gitlens.amod.io/

https://vscodium.com/

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.