Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diff last modifications to a file

Tags:

git

I am using this (bash):

git diff $(git log -1 --pretty=format:"%H" somefile)^! -- somefile

Is there a simpler way to do it?


1 Answers

For the most recent changes to a file:

git log -p -1 <filename>

For all changes to a file:

git log -p <filename>

or, to get a graphical view:

gitk <filename>
like image 171
Dan Kreiger Avatar answered Jul 05 '26 05:07

Dan Kreiger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!