我怎么知道分支是否已经合并到master中? [英] How can I know if a branch has been already merged into master?

查看:248
本文介绍了我怎么知道分支是否已经合并到master中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有多个分支的git存储库.

I have a git repository with multiple branches.

我怎么知道哪些分支已经合并到master分支中?

How can I know which branches are already merged into the master branch?

推荐答案

git branch --merged master列出合并到 master

git branch --merged列出合并到 HEAD 中的分支(即当前分支的尖端)

git branch --merged lists branches merged into HEAD (i.e. tip of current branch)

git branch --no-merged列出尚未合并的分支

默认情况下,这仅适用于本地分支机构. -a标志将显示本地和远程分支,而-r标志仅显示远程分支.

By default this applies to only the local branches. The -a flag will show both local and remote branches, and the -r flag shows only the remote branches.

这篇关于我怎么知道分支是否已经合并到master中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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