How to find last merge in git?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)