Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explore git-diff output in a GUI?

Tags:

git

git-diff

Is there program that allows output of a git-diff command to be explored in a GUI?

What i am looking for is something similar to the how SmartGit displays its view of the differences between the working copy and the HEAD. Where each of the files that are different to the HEAD are displayed and the diff for the focused file is displayed.

I am not sure if it is possible to make SmartGit display the output of a "git diff" command.

alt text

like image 340
Frank Avatar asked Nov 11 '10 23:11

Frank


People also ask

How do I see git diff?

You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch.

What is the output of git diff?

Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.

Why is git diff not showing?

Why do you get no git diff output before adding? Git does not treat files in the filesystem as automatically included in the version control system. You have to add things explicitly into the Git repository (as you are doing by adding the current directory with git add . ).

How do I get out of git diff command?

Use ONLY q+enter to exit. It's possible to break out by repeatedly typing q+enter+q+enter+q+enter until the end of time no matter what the console shows.


1 Answers

Starting with git v1.7.11, you can use git difftool --dir-diff to perform a directory diff.

The answer that follows applies to git installations older than v1.7.11.


As mentioned by others, git difftool may be used to open your diff in a GUI. However if you have multiple files with changes, it will open a separate instance of the GUI for each file.

I wrote a script to work around this "feature" and allow all the files to be opened in a single GUI instance. You can find the git diffall script on GitHub.

Also, you may be interested in this related SO question:

git difftool, open all diff files immediately, not in serial

like image 194
Tim Henigan Avatar answered Sep 30 '22 02:09

Tim Henigan