我如何知道一个分支是否已经合并到 master 中?
问题描述:
我有一个带有多个分支的 git 存储库.
I have a git repository with multiple branches.
如何知道哪些分支已经合并到主分支了?
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.