How to find last merge in git?

后端 未结 7 1504
野的像风
野的像风 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条回答
  •  渐次进展
    2020-12-29 04:47

    git log --merges -n 1
    

    works well. From man git-log:

       --merges
           Print only merge commits. This is exactly the same as --min-parents=2.
    

    Here's an example using --pretty=format:"%H" to get just the SHA.

    $ git log --pretty=format:"%H" --merges -n 1
    f32e1f13eef7d5843e8063b8709d01af6dcd5dbf
    

    Credit goes to Jefromi for their comment on another answer.

提交回复
热议问题