← 返回命令列表

Linux command

git-delete-branch 命令

安全

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

常用示例

Delete local and remote branch

git delete-branch [branch]

说明

git delete-branch deletes a branch both locally and on the remote in a single command. Part of the git-extras collection, it simplifies branch cleanup by combining what would normally require separate git branch -D and git push origin --delete operations. The command is particularly useful in pull request workflows where feature branches become obsolete after merging. Multiple branches can be passed and will each be deleted in turn.

FAQ

What is the git-delete-branch command used for?

git delete-branch deletes a branch both locally and on the remote in a single command. Part of the git-extras collection, it simplifies branch cleanup by combining what would normally require separate git branch -D and git push origin --delete operations. The command is particularly useful in pull request workflows where feature branches become obsolete after merging. Multiple branches can be passed and will each be deleted in turn.

How do I run a basic git-delete-branch example?

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