erikvold
erikvold

Reputation: 16528

Is there a quick way to see if a commit hash is in a particular tree's history?

Can I compare a commit to a branch and see if there is a diff, or just get a yes / no answer to the question somehow?

Upvotes: 1

Views: 78

Answers (2)

CB Bailey
CB Bailey

Reputation: 791899

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>

Upvotes: 2

erikvold
erikvold

Reputation: 16528

Ah:

git log <commit hash>

Upvotes: 0

Related Questions