I want to delete a local branch in Git but this failed:
git branch -d
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>
git branch -D <branch_name>
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>