简体   繁体   English

知道第三个分支何时合并到 master

[英]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.假设我有一个名为 feature 的分支,我从这个分支创建称为 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!!感谢你们!!

To list all commits on subfeature , but not on master , use:要列出subfeature上的所有提交,而不是master上的所有提交,请使用:

git log master..subfeature

which is equivalent to:这相当于:

git log subfeature ^master

(which can be written as git log subfeature --not master ) (可以写成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, …)当然, mastersubfeature都可以替换为任何 commit-ish(分支名称、跟踪分支、标签、提交 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM