git – How to list branches that contain a given commit?

Need to see which branch(es) contain a Git commit? Try these commands!

List local branches that contain a commit:

git branch --contains <commit>

List remote branches that contain a commit:

git branch -r --contains <commit>

List all (local & remote) branches that a commit:

git branch -a --contains <commit>

via git – How to list branches that contain a given commit? – Stack Overflow.

Advertisement

Author: Adam Prescott

I'm enthusiastic and passionate about creating intuitive, great-looking software. I strive to find the simplest solutions to complex problems, and I embrace agile principles and test-driven development.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: