Answer: How do I delete a Git branch locally and remotely?

ianonjuguna

Iano Njuguna

Posted on November 15, 2023

Answer: How do I delete a Git branch locally and remotely?

Executive Summary

git push -d <remote_name> <branchname&gt
git branch -d <branchname>

Note: In most cases, <remote_name> will be origin.

Delete Local Branch

To delete the local branch, use one of the following:

git branch -d <branch_name>
git branch -D <branch_name>
  • The -d option is an alias for --delete
💖 💪 🙅 🚩
ianonjuguna
Iano Njuguna

Posted on November 15, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related