Git is a DAG of snapshots, with each node on the graph representing a commit. Each commit can have \'n\' parent commits.
Given any two commits, is there a single, co
To build on @helmbert's excellent git related alias, here's a version which also accepts branch names (or HEAD etc) as arguments, rather than just commit ids:
git config --global alias.related '!function git_related() { commit1=`git log -n 1 --format="%h" $1` ; commit2=`git log -n 1 --format="%h" $2` ; if git rev-list $commit1 | grep -q $commit2 ; then echo "$2 is ancestor of $1" ; elif git rev-list $commit2 | grep -q $commit1 ; then echo "$1 is ancestor of $2" ; else echo "$1 unrelated to $2" ; fi } ; git_related $1 $2'