有时候分支过多,不知道是否已经合并过,使用如下命令可以检测:
git branch --merged master | grep xxx
--contains [<commit>]
Only list branches which contain the specified commit (HEAD if not specified). Implies --list.
--no-contains [<commit>]
Only list branches which don’t contain the specified commit (HEAD if not specified). Implies --list.
--merged [<commit>]
Only list branches whose tips are reachable from the specified commit (HEAD if not specified). Implies --list.
--no-merged [<commit>]
Only list branches whose tips are not reachable from the specified commit (HEAD if not specified). Implies --list.
官方文档:
git branch