← 返回命令列表

Linux command

git-delete-squashed-branches 命令

安全

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

常用示例

Delete squash-merged branches

git delete-squashed-branches

说明

git delete-squashed-branches deletes local branches that have been squash-merged into the current branch. Part of git-extras, it detects branches whose commits were combined and merged as a single squash commit, which Git's standard --merged flag cannot identify. Squash merging creates a new commit combining all branch changes, leaving the original branch commits technically unmerged. This causes branch accumulation since git branch --merged won't flag them for deletion. The command uses tree comparison heuristics to detect when a branch's changes exist in the target branch despite differing commit history. Particularly useful for workflows on GitHub and GitLab where squash merging is the default merge strategy.

FAQ

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

git delete-squashed-branches deletes local branches that have been squash-merged into the current branch. Part of git-extras, it detects branches whose commits were combined and merged as a single squash commit, which Git's standard --merged flag cannot identify. Squash merging creates a new commit combining all branch changes, leaving the original branch commits technically unmerged. This causes branch accumulation since git branch --merged won't flag them for deletion. The command uses tree comparison heuristics to detect when a branch's changes exist in the target branch despite differing commit history. Particularly useful for workflows on GitHub and GitLab where squash merging is the default merge strategy.

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

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