How to delete a Git branch both locally and remotely

git_logo

If you are not using a gui for github like Sourcetree or Github desktop but you prefer using git from console then you might might wondering how you can delete a branch both from server/remote and from local. The commands you can use are the following:

To delete the local branch use:

If you use -D, which is an alias for --delete --force, which deletes the branch “irrespective of its merged status.”

And to delete the remote branch you can use:

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.