Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compare file with its previous version in TortoiseGit

I used git bisect to locate the commit that broke stuff. Now I want to compare file with its previous version but when I right click a file in Log Messages window I have only "Compare with base" and "Compare with working tree" and that's useless for me.

How can I easily compare a file from some old commit with its previous version?

I just want to see what was added/deleted in that particular commit in that file. This what TortoiseSvn normally does when you double click a file in Log Messages window. I would prefer to get that outcome using TortoiseGit and WinMerge but if its not possible any other tool is also good.

Thanks in advance.

like image 864
szym Avatar asked Oct 21 '25 03:10

szym


1 Answers

git diff HEAD^

HEAD is the latest version, and ^ means "prior". For example, HEAD^^ means 2 back.

like image 131
AndrewStone Avatar answered Oct 23 '25 20:10

AndrewStone