Git:如何找到所有从未合并回主的分支 [英] Git: How to find all branches that were never merged back into master

查看:120
本文介绍了Git:如何找到所有从未合并回主的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个相当大的GIT repo,我想删除那些从未合并回master的分支。

反过来也好 - 列出的方法所有分支在某个时间点都被合并到了主分支中。

我想要一个列表开始,而不是马上删除分支,因为有些分支可能会值得保留或最近在开发中。



所以问题是:是否有办法列出所有从未将它们的任何更改合并回来的分支 master

解决方案

git branch --no-merged master



或者换句话说, git branch --merged master



文档


We have a fairly large GIT repo and I would like to remove branches that were never merged back into master.

The reverse is fine too - a way to list all branches that have been merged into master at some point.

I would like a get a list to begin with rather then simply deleting the branches right away, since some branches may be worth keeping still or have been in development more recently.

So the question is: Is there a way to list all branches that never had any of their changes merged back into master?

解决方案

git branch --no-merged master

Or for the other way, git branch --merged master

docs

这篇关于Git:如何找到所有从未合并回主的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆