How to delete git branch locally and in remote repo | The Dev Tool | Toolel.com

To delete a local branch you need

git branch -d <branch_name>

where if you write [-d] it only deletes the branch if it has already been fully merged in its upstream branch or if you write [-D] it deletes the branch "irrespective of its merged status."

To delete a remote branch

git push -d <remote_name> <branchname>

and in most cases, <remote_name> will be origin

Created by: martin

Comments

This page is only partially working without JavaScript. It will show content, but the tools and interactivity cannot be shown without JavaScript enabled. Please enable JavaScript for this page. About Us