git merge-base takes two commits (which, as usual, can be commit-hashes, branch, tags, etc.) and returns a common ancestor they both deviated from.
:.
mureinik@comupter ~/src/git/myproject [master] $ git merge-base master feature-1
7c2232a4dd6c54ee8cc3f693ab8a0020ad82410b