Look up commit log for commit ID in Git

Git

Git Problem Overview


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 Solutions


Solution 1 - Git

git show <commit_id>

is the droid you are looking for, probably.

Solution 2 - Git

@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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionShraddhaView Question on Stackoverflow
Solution 1 - GitSeth RobertsonView Answer on Stackoverflow
Solution 2 - GitNoitidartView Answer on Stackoverflow