[How To] Delete local and remote branch in Git

If you need to delete a branch from local repository and remote server.

1. Delete branch from local:
First make sure you are on a different branch than the one you want to delete. Then you can proceed with deletion.

git checkout other-branch
git branch -D branch-to-delete

2. Delete branch from remote:

git branch -D -r origin/branch-to-delete
git push origin --delete branch-to-delete



Attached Files
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Security Code Security Code
Related Articles RSS Feed
[How To] Rename a local and remote branch in git
Viewed 1870 times since Mon, Mar 6, 2017