How to Delete a git Remote Branch?

how to delete local branch in gitIt’s important to keep a clean repository; not just a clean code base, but a clean repository in so far as spare branches don’t rot around. The main repository generally doesn’t hold multiple branches, but sometimes you need to push to the main repository just to get Travis CI to run tests. For example, once a branch is merged we don’t need it around anymore.

It is easy to delete a branch on a local host repo:

git branch -d 

You may also come to a situation where you need to delete a remote branch from git. You should execute: To delete a branch from the remote git repository, like a repository hosted by GitHub:

git push  --delete 

So, isn’t it very easy to remove a git remote branch? From next time onwards you can easily delete the remote branch from git.

Stay Updated with ci3school

Leave a Reply