Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git show for a specific file?

Tags:

git

I want to see what was changed in a specific commit.

No Problem

git show 123456

But this commit has a ton of changes, I want to see only changes for one specific file

Let me try this

git show 123456:/foo/bar/my.file

Well, works. But not as expected. The above command will show me the entire file in rev. 123456 - but I want to see the diff for this rev (as it is for git show 123456).

like image 294
boop Avatar asked Dec 30 '25 23:12

boop


1 Answers

Use the "--" separator:

git show 123456 -- /foo/bar/my.file
like image 179
nofinator Avatar answered Jan 02 '26 14:01

nofinator



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!