Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

How do I delete a Git branch locally and remotely?

Executive Summary
$ git push -d <remote_name> <branchname>
$ git branch -d <branchname>

Delete Local Branch
$ git branch -d <branch_name>
$ git branch -D <branch_name>

Delete Remote Branch
As of Git v1.7.0, you can delete a remote branch using
$ git push <remote_name> --delete <branch_name>
which might be easier to remember than
$ git push <remote_name> :<branch_name>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #delete #Git #branch #locally
ADD COMMENT
Topic
Name
6+3 =