6

かなり大きな GIT リポジトリがあり、master にマージされなかったブランチを削除したいと考えています。

逆も問題ありません。これは、ある時点で master にマージされたすべてのブランチを一覧表示する方法です。

一部のブランチはそのままにしておく価値があるか、最近開発されている可能性があるため、ブランチをすぐに削除するのではなく、最初にリストを取得したいと思います。

問題は、変更がmasterにマージされていないすべてのブランチを一覧表示する方法はありますか?

4

2 に答える 2

17

git branch --no-merged master

または他の方法では、git branch --merged master

ドキュメント

于 2013-10-29T06:18:21.353 に答える
1

git help branch言います:

   With --contains, shows only the branches that contain the named commit
   (in other words, the branches whose tip commits are descendants of the
   named commit). With --merged, only branches merged into the named
   commit (i.e. the branches whose tip commits are reachable from the
   named commit) will be listed. With --no-merged only branches not merged
   into the named commit will be listed. If the <commit> argument is
   missing it defaults to HEAD (i.e. the tip of the current branch).

したがって、すでに master にマージされているすべてのブランチを見つけるには、 を使用できますgit branch --merged master

于 2013-10-29T06:19:52.807 に答える