← 返回命令列表

Linux command

git-delete-merged-branches 命令

安全

复制后可按需替换文件名、目录或参数。

常用示例

Delete merged branches

git delete-merged-branches

说明

git delete-merged-branches deletes all branches that have been merged into the current branch, automating post-merge cleanup. Part of the git-extras toolkit, it identifies branches whose changes are fully incorporated into the current branch and removes them in batch. The command uses Git's merge-base calculation to determine which branches are safe to delete, ensuring that only branches with no unique commits are removed. It is commonly run after release cycles or as part of repository maintenance routines to prevent branch sprawl.

FAQ

What is the git-delete-merged-branches command used for?

git delete-merged-branches deletes all branches that have been merged into the current branch, automating post-merge cleanup. Part of the git-extras toolkit, it identifies branches whose changes are fully incorporated into the current branch and removes them in batch. The command uses Git's merge-base calculation to determine which branches are safe to delete, ensuring that only branches with no unique commits are removed. It is commonly run after release cycles or as part of repository maintenance routines to prevent branch sprawl.

How do I run a basic git-delete-merged-branches example?

Run `git delete-merged-branches` in a terminal, then adjust file names, paths, flags, or remote targets for your system.