Identify branches containing a specific commit Only local branches: git branch --contains <commit>List local branches that include the specified commit. To include remote branches as well: git branch -a --contains <commit>List all branches that contain commit <commit>, including remote branches.