Let\'s say I have the following local repository with a commit tree like this:
master --> a \\ \\ develop c --> d
An alternative: git rev-list master | grep "$(git rev-list HEAD)" | head -1
git rev-list master | grep "$(git rev-list HEAD)" | head -1
Get the last commit that it's both my branch and master (or whatever branch you want to specify)
master