From syntax of git branch at http://git-scm.com/docs/git-branch , the last optional parameters are either "commit" or "pattern".
git branch [--color[=<when>] | --no-color] [-r | -a]
[--list] [-v [--abbrev=<length> | --no-abbrev]]
[--column[=<options>] | --no-column]
[(--merged | --no-merged | --contains) [<commit>]] [<pattern>...]
So in the command "git branch --merged master", is "master" considered the commit name or pattern? (I'm guessing 'master' in this command is referring to local branch master.)
What is the difference between "git branch --merged master" vs. "git branch --merged develop"? Will the output of the command vary if the checked out branch is master vs. develop?
I saw this post, but quite didn't understand what the "master" parameter value maps to in the command syntax. Git: How to find all branches that were never merged back into master
git branch --merged
will show you all branches which have been merged into the commit you give on the command line. If you specify master
, that will be the tip (last) commit on your branch master. Same goes for develop
.
It doesn't matter which branch you have currently checked out, unless you don't specify a commit (ie only git branch --merged
). Then the currently checked out HEAD
will be used.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.