In order to find the last time a branch was merged in, I would use git merge-base
. This shows the latest commit that both the branches have in common.
git merge-base origin/develop origin/master
This will provide the latest common SHA in both branches giving you an idea when they were last merged. You can pipe the commit SHA into git log
and see the last commit.
git merge-base origin/develop origin/master | xargs git log -1
If you want to see all the commits on the branch since this SHA:
git merge-base origin/develop origin/master | xargs -I sha git log sha..origin/develop
With this you will be able to see a list of all the commits made on origin/develop
that are not yet on origin/master
.