Pagine

Wednesday 3 May 2017

How to delete local and remote branches with git

Delete a local branch

Use the following command to delete a branch already merged:
 git branch -d <branch_name>
If the branch is not merged, use -D option to force the delete:
 git branch -D <branch_name>

Delete a remote branch

Use one of following commands to delete a remote branch (valid with git version 1.7 or later):
 git push origin --delete <branch_name>
or
 git push origin :<branch_name>

No comments:

Post a Comment