git branch -a
feature
feature-0001
* main
- If the branch has not been fully merged, git will display an error message and prevent the branch from being deleted.
git branch -d feature-0001
error: The branch 'feature-0001' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feature-0001'.
- Following command forces git to delete the branch, regardless of whether it has been fully merged or not.
git branch -D feature-0001
Deleted branch feature-0001 (was d99c263).
git branch -d feature
Deleted branch feature (was a97f348).
git branch -a
* main