Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I need to find a commit in Git by a given hash, SHA. For example, if I have the "a2c25061" hash, and I need to get the author and the committer of this commit. What is the command to get that?

1 Answer

0 votes
by (50.2k points)

To find a commit using Sha can be achieved by using git show command:

Syntax

git show <sha-id>

For your case, it will be 

git show a2c25061

To get only about the commit, not about the diff you can use --stat option as well.

Related questions

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...