我怎么知道分支是否已经合并到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.