find last merged git branch in master


I have main branch in git: master

and a number of feature branches: feature/adding-some-func and etc.

After the merging feature branch to master I have commit with message like:

Merge pull request #33 in test-proj from feature/adding-some-func to master

How can i get the name of just merged branch(feature/adding-some-func) after the cloning repository? So, as result I need to get feature/adding-some-func but in the logs i see only SHA, Commit Authors


If you want to be very specific, you can use:

git log --merges origin/master --oneline --grep='^Merge pull request #\([0-9]\+\) in \(.\+\) from \(.\+\) to master' -1

Answered By – Roberto Nascimento

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published