Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using gitk, can I see the difference between 2 commits?

Tags:

git

gitk

I have tried:

git diff sha1 sha2 

But the output isn't the best, is it possible to see the difference between 2 commits using gitk?

like image 880
Blankman Avatar asked Dec 05 '12 03:12

Blankman


People also ask

Can we compare two commits in git?

You can compare a single commit in Git to the commit's predecessors using two types of notation. One commit prior. Repeat the ^ character to indicate one more commit further back in the history.

How do I compare files between two commits in git?

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. Order does matter when you're comparing branches.

Which command show the changes between commits?

git diff --cached --merge-base A is equivalent to git diff --cached $(git merge-base A HEAD) . This form is to view the changes you have in your working tree relative to the named <commit>. You can use HEAD to compare it with the latest commit, or a branch name to compare with the tip of a different branch.

How do I compare two commits in Sourcetree?

Another way to do this is to right-click on a branch and select the "Diff against current" context menu command (current refers to the branch you are currently working on). This will give you the diff between the head commits of the two branches.


1 Answers

In windows at least it is perfectly possible :

enter image description here

like image 186
Mr_and_Mrs_D Avatar answered Oct 02 '22 17:10

Mr_and_Mrs_D