13.6MviewsStack Overflow
Delete a Git branch locally and remotely
git branch -d removes your local copy (-D forces it when the branch is not merged); git push origin --delete removes the copy on the remote.
Commits, branches, remotes and the messages Git prints when something goes wrong.
git branch -d removes your local copy (-D forces it when the branch is not merged); git push origin --delete removes the copy on the remote.
git reset --soft HEAD~1 removes the last commit and keeps your changes staged; git reset --hard HEAD throws the changes away too.
The branch has commits that are not merged into your current branch, so -d refuses to delete it. Older Git versions print it as The branch 'feature/login' is not fully merged.
The branch is already gone from the remote (often a teammate deleted it), but your copy of the remote branch list is out of date.