[英]How can I verify that a git project's release branch's fixes have all been merged into master?
I have a git repository for a project at work. 我有一个正在工作的项目的git存储库。 Each time we release a version of our software, we create a release branch for it. 每次发布软件版本时,都会为其创建一个发布分支。 There's a release1.0 branch, a release 1.1 branch, etc. When we need to create a hotfix for that release, we commit the fix to that release branch, and then we merge that fix into our master development branch. 有一个release1.0分支,一个1.1版分支等。当需要为该发行版创建修补程序时,我们将该修复提交到该发行版分支,然后将其合并到我们的主开发分支中。
Sometimes we forget that last step in our rush to fix a production bug, and then a new release goes out without the hotfix for our previous problem. 有时,我们忘记了急于修复生产错误的最后一步,然后一个新版本发布,而没有针对我们先前问题的修补程序。
Is there an easy git command that checks to see if all our our release branches have been merged into master, and if not, which commits in which branches? 是否有一个简单的git命令来检查我们所有的发行分支是否已合并到master中,如果没有,则检查哪个分支在哪个分支中提交?
You could try git branch --no-merged master
. 您可以尝试git branch --no-merged master
。 This should list all branches that haven't been merged into master
. 这应该列出所有尚未合并到master
分支。
Another approach is to type git log master..branch
, which will show empty results if branch is merged into master, and will otherwise present a list of unmerged commits. 另一种方法是键入git log master..branch
,如果将分支合并到master中,它将显示空结果,否则将显示未合并提交的列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.