Omar Ayala
Omar Ayala

Reputation: 123

Know when a third branch has been merged to master

This might be an easy question for some of you.

Let's say I have a branch which is called feature, and from this branch I create sub branches called sub-features. The right way of merge would be to merge sub-feature in feature and then feature to master.

So here is my question how can I know when (if it has been done already) a sub-feature branch has been merged to master as well. I am doing this manually by chasing merge commits but is a bit tedious and of course might have some human errors.

Good to say sub-feature branches have been removed but of course I have the commits refs.

Thank you guys!!

Upvotes: 0

Views: 39

Answers (1)

knittl
knittl

Reputation: 265201

To list all commits on subfeature, but not on master, use:

git log master..subfeature

which is equivalent to:

git log subfeature ^master

(which can be written as git log subfeature --not master)

Of course, both master and subfeature can be replaced by any commit-ish (branch name, tracking branch, tag, commit hash, …)

If you want to know to which branches a commit has been merged (in other words, answering the question: which branches contain this commit?):

git branch --contains commithash

Upvotes: 1

Related Questions