Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

Delete a branch – Git


To delete a branch in Git, enter the following command in your terminal:

git branch -d branch-name


Before you run the above command, make sure you’re on a different branch than the one you’re trying to delete. You can switch branches by entering the following command in your terminal:

git checkout other-branch

After running the delete command, you should see something similar to the following output:

Deleted branch branch-name (was 1f0de91).


Use the following command to delete the dev-branch:

git branch -d dev-branch


Basic Branching and Merging from the Pro Git book

Back to: Git Reference > Git Intermediate