Adam K Dean

Remove branch from remote git repo

Published on 4 August 2014 at 12:35 by Adam

To remove a branch from a remote git repository, you have to push an empty branch.

$ git push origin :branch-name
- [deleted]        branch-name

If you want to also remove it from the local repo, delete the branch:

$ git checkout master 
Switch to branch 'master'

$ git branch -D branch-name
Deleted branch branch-name (was abcd123)

We change branch as you can't delete the branch you're on.



This post was first published on 4 August 2014 at 12:35. It was filed under archive with tags git.