How to check if a merge has been merged with my current branch - somewhere in time?

I have a random / XXXXXXX branch, which has some commits and, of course, "develops" a branch where these functions eventually merge.

How to check if there was some old commit (e.g. commit ab123456 from the user branch / login function) was somehow included / reduced into my active branch (e.g. development)? Either by directly merging the feature branch for development, or by moving / merging through some other intermediate branch.

Through git commands or through the SourceTree interface, both methods are equally suitable for me.

+5
source share
3 answers

Decision

You can directly ask git which (local) branches contain your commit, for example:

git branch --contains ab123456 

use the -r option to request remote branches, for example:

 git branch -r --contains ab123456 

References

As Andrew C. comments, this is almost a duplicate. How to properly display branches containing a given commit? , answered VonC correctly and thoughtfully.

Note

Now I see that Sulli also gives the same answer in this thread.

+11
source

Using the following command:

 git branch --contains <commit-id> 

This will output every branch containing the commit. Therefore, if your current branch has it, it should appear on the output.

+1
source

WITH

 git log --oneline devBranch..featureBranch 

You see that all commits are present in featureBranch and not in devBranch

0
source

Source: https://habr.com/ru/post/1241823/


All Articles