github - How to find the branch from commit id -


so, trying find branch name in given commit made. (c853d8cf3ae34dae9866b874b96c6529515d7e90)

i have parent id , commit id referenced on git issue.
how can find given commit id pushed in 'x' branch?

on github specifically, can see branch given commit part of.
blog post "branch , tag labels commit pages" details:

if commit not on default branch, indicator show branches contain commit.
if commit part of unmerged pull request, link shown.

link pull request

once commit makes default branch, tags contain commit shown, , default branch branch listed.

branch part of commit


original answer

you can list branches:

git branch --contains <commit>  # in case git branch --contains <commit> | grep x 

more details in "git: finding branch commit came from".

don't forget commit can part of several branches.


Comments