I want to look at a commit by ID. For instance, I want to know the code that got committed for that ID, something like:
git log <commit_id>
And this would display the committed code and commit message that corresponds to this ID.
I want to look at a commit by ID. For instance, I want to know the code that got committed for that ID, something like:
git log <commit_id>
And this would display the committed code and commit message that corresponds to this ID.
git show <commit_id>
is the droid you are looking for, probably.
git branch --contains <commit>
Aug 28, 2018 at 17:44
git show XXXX --
It is required to differentiate between a file and a commit ID.
Oct 2, 2018 at 14:11
git show <commit_id> --no-patch
if you want to see the same look as git log
Dec 8, 2018 at 17:36
@SethRobertson's solution works for me but it shows a diff. I wanted to see it exactly like git log
shows it. So add --no-patch
:
git show <commit_id> --no-patch
I learned this from - https://stackoverflow.com/a/31448684/1828637
-p
can be useful here too.