Can I compare a commit to a branch and see if ther开发者_StackOverflow社区e is a diff, or just get a yes / no answer to the question somehow?
If a commit is on a branch's history then this list of commits will be empty, otherwise there will be at least one commit (the given commit).
git rev-list <branch_id>..<commit_id>
Ah:
git log <commit hash>
精彩评论