How to find last merge in git?

后端 未结 7 1480
野的像风
野的像风 2020-12-29 04:31

For a web site, I have master and staging, I have worked on staging for about 10 days. How do I tell for sure what has changed since my last merge, or when that merge was? M

7条回答
  •  Happy的楠姐
    2020-12-29 04:56

    An alternative which does not rely on the content of the commit message:

    $ git rev-list --min-parents=2 --max-count=1 HEAD
    9c6e6d6b6b9bd293335700e34e05217ae8e7a7e8
    

    --min-parents=2 selects only commits which are merges, --max-count=1 only shows the first commit when going back in history. If the specified commit (HEAD) does not have any merge commits in its history, the output will be empty.

提交回复
热议问题