8

I have removed a branch I have after merging it with the master. However, the locally deleted branch is not deleted on remote repo (on github).

On a suggestion in one answer here, I tried git push remote :branch that didn't seem to help. --prune option didn't seem to help either. I think I can go ahead and delete the branch remotely as well, but I don't want to be checking it and tracking with every branch.

Any ideas?

1

1 Answer 1

12

You want to use this...

git push remote --delete <branch-name>

Although git push remote :branch should have worked. The command says push this branch without a local set, effectively deleting it.

Are you sure the name of your remote is remote? Could it be origin? Use git remote -v to list your remotes.

Failing that, you can delete branches using GitHub's UI.

2
  • Are you replacing branch there with the name of the remote branch?
    – alex
    Jan 19, 2016 at 13:39
  • Yep, sure. But didn't work. Jan 19, 2016 at 13:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.