How can I tell if one commit is an ancestor of another commit (or vice-versa)?

Use git merge-base –is-ancestor <commit1> <commit2> There is more than one way to find the answer to this. The simplest is to use git merge-base –is-ancestor <possible-ancestor-commit> <commit> From the documentation for git merge-base: –is-ancestor Check if the first <commit> is an ancestor of the second <commit>, and exit with status 0 if true, or … Read more