I’m using Git Flow for my project, and have completed the git flow feature finish step that merged my feature branch into my develop branch.
I then performed git push to GitHub, but on GitHub I still see the feature branch as well as develop.
When I run git branch locally, I only see develop and master, which is what I’d expect.
How can I remove the branch from GitHub? I could cope with this one, but if this happens for every feature I’ll end up with a massive list of old branches.
Many thanks in advance.
Assuming the
originremote refers to your GitHub respository, you can delete the merged branch with:To explain that syntax further, when you do:
… the
some-branchparameter is actually a “refspec” which defines a mapping between a source name and a destination name, usually of the form<source-name>:<destination-name>. If there’s no:in the refspec, it assumes that you meansome-branch:some-branch. The way to say “I just want to delete the remote branch” is to miss out the<source-name>completely, just ending up with:followed by the remote branch name.