Delete git branch both remote and local


There are simple way to delete git branch locally and remote.
But first thing to do, you should move from branch that you will delete.
Just checkout master or development branch and start removing git branch.

1
2
3
git checkout <not-branch-name>
git branch -D <branch-name>
git push origin :<branch-name>

To create new github branch that clone from another branch and checkout automatically :

1
2
git checkout -b <new-branch>
git push origin <new-branch>

Simple!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.