我怎么能在git中知道一个分支是否已经被合并到master中? [英] How can I know in git if a branch has been already merged into master?
问题描述
我有一个有多个分支的git仓库。
如何知道哪些分支已经合并到主分支中?
git branch --merge master
列出分支合并到master
git branch --merged
列出分支合并到 HEAD (即当前分支的尖端)
git branch --no-merged
列出尚未合并的分支
默认情况下,这仅适用于当地的分支机构。 -a
标志将显示本地和远程分支,并且 -r
标志仅显示远程分支。 / p>
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
lists branches merged into master
git branch --merged
lists branches merged into HEAD (i.e. tip of current branch)
git branch --no-merged
lists branches that have not been merged
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.
这篇关于我怎么能在git中知道一个分支是否已经被合并到master中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!