かなり大きな GIT リポジトリがあり、master にマージされなかったブランチを削除したいと考えています。
逆も問題ありません。これは、ある時点で master にマージされたすべてのブランチを一覧表示する方法です。
一部のブランチはそのままにしておく価値があるか、最近開発されている可能性があるため、ブランチをすぐに削除するのではなく、最初にリストを取得したいと思います。
問題は、変更がmasterにマージされていないすべてのブランチを一覧表示する方法はありますか?
かなり大きな GIT リポジトリがあり、master にマージされなかったブランチを削除したいと考えています。
逆も問題ありません。これは、ある時点で master にマージされたすべてのブランチを一覧表示する方法です。
一部のブランチはそのままにしておく価値があるか、最近開発されている可能性があるため、ブランチをすぐに削除するのではなく、最初にリストを取得したいと思います。
問題は、変更がmasterにマージされていないすべてのブランチを一覧表示する方法はありますか?
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
。