Find commit by hash SHA in Git

前端 未结 3 1916
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 18:30

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 i

3条回答
  •  离开以前
    2021-01-29 19:14

    There are two ways to do this.

    1. providing the SHA of the commit you want to see to git log

    git log -p a2c25061

    Where -p is short for patch

    2. use git show

    git show a2c25061

    The output for both commands will be:

    • the commit
    • the author
    • the date
    • the commit message
    • the patch information

提交回复
热议问题