How to delete a local branch in git?


I want to delete a local branch in Git but this failed:

git branch -d <branch_name>


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>

Answered By – mahbub_siddique

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published