The scenario is that we work on a GitHub project and we would like to delete a branch from the remote repository. This is common when we work with “feature” branches and the feature is complete and merged. First, we can find the remote branches by typing:
git branch -r
Let’s say that we want to delete the new_feature
remote branch. Then we can run the command:
git push origin --delete new_feature
An alternative way is to run:
git push origin :new_feature