Reputation: 163
I want to delete a local branch in Git but this failed:
git branch -d <branch_name>
Upvotes: 1
Views: 1214
Reputation: 826
for more info . hidden deep from online documentation:
--delete
, and--delete --force
.Upvotes: 2
Reputation: 3576
Your command to delete a branch is correct:
git branch -d <branch_name>
But you may have an error message indicating you need to use the -D option to force the deletion of the branch:
git branch -D <branch_name>
Upvotes: 1
Reputation: 1795
If you edit your branch & want to delete it without merging it to your master branch, you have to force delete it with the option -D
instead of -d
.
git branch -D <branch_name>
Upvotes: 11