Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git show commit in beyond compare

Tags:

I would like to see a specific commit in Beyond Compare or any other separate diff tool while viewing it via git show. I tried looking at help of git show/difftool/config but couldn't find anything. Does anyone know how it can be done?

I've looked at Git Diff with Beyond Compare and configured Beyond Compare for git difftool but I also want to use it as tool from git show

like image 669
Manish Avatar asked Sep 22 '11 13:09

Manish


Video Answer


2 Answers

I managed to use git difftool to see commits that I normally used to see via git show.

git show $commit translates to git difftool $commit^ $commit.

The above command shows difference between commit's parent ($commit^) and commit. All this is of course after configuring Beyond Compare with difftool.

like image 128
Manish Avatar answered Sep 27 '22 20:09

Manish


You can also create an alias "showtool" to wrap the call to git difftool:

set +o histexpand git config --global alias.showtool "!sh -c 'if [ -z \$1 ]; then REVISION="HEAD"; else REVISION="\$1"; fi; git difftool \$REVISION~ \$REVISION' -" 

.. then you can execute:

git showtool 81e945b 

.. or just

git showtool 

.. as a shortcut for git difftool 81e945b~1 81e945b to show the changes introduced in 81e945b using the configured difftool, or in the second case git difftool HEAD~1 HEAD

like image 44
javabrett Avatar answered Sep 27 '22 22:09

javabrett