Command

Git Delete Branch Command

The Git command to delete branch is git branch -d <name>.

Quick Answer

Command
git branch -d <name>
GitCommand

Delete Branch

Type this command
git branch -d <name>

Deletes a local branch that has been merged.

Tip: Use -D to force-delete an unmerged branch.

Learn More

How to delete branch in Git

  1. Open the terminal or command interface for Git.
  2. Type git branch -d <name>, replace any placeholders, and run it.

Tip: Use -D to force-delete an unmerged branch.

Git Delete Branch Command

Run git branch -d <name>.

Related Commands

Frequently asked questions

What is the Git command to delete branch?

Run git branch -d <name>.

Where do I type this Git command?

Type it in the terminal or command-line interface used by Git.

Does this Git command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify