$ git push -d <remote_name> <branchname> $ git branch -d <branchname>
Note: In most cases,
<remote_name> will be
Delete Local Branch
To delete the local branch use one of the following:
$ git branch -d <branch_name> $ git branch -D <branch_name>
-doption is an alias for
--delete, which only deletes the branch if it has already been fully merged in its upstream branch.
-Doption is an alias for
--delete --force, which deletes the branch "irrespective of its merged status." [Source:
- You will receive an error if you try to delete the currently selected branch.