I have a Git repository with many branches, some of them already merged and some not. Since the number of branches is quite large, how can I determine which branches have not yet been merged? I would like to avoid having to do an "octopus" merge and re-merging branches that have already been merged.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
Try this:
It does what it says on the tin (lists branches which have been merged into
master
). You can also pull up the inverse with:If you don't specify
master
, e.g...then it will show you branches which have been merged into the current
HEAD
(so if you're onmaster
, it's equivalent to the first command; if you're onfoo
, it's equivalent togit branch --merged foo
).You can also compare upstream branches by specifying the
-r
flag and a ref to check against, which can be local or remote:The below script will find all
origin/*
branches that are ahead of current branchThe up-to-date version of the script
You can also use the -r parameter to show remote branches that were not merged into master:
If a branch is merged already, merging it again won't do anything. So you don't have to be worried about "re-merging" branches that are already merged.
To answer your question, you can simply issue
to see the merged branches or
to see the unmerged branches. Your current branch is implied but you can specify other branches if you wish.
will show you branches that are not yet merged into
integration
branch.