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.

Advertisements

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 )

Google+ photo

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

Connecting to %s