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?

H.Aziz Kayıhan
  • 315
  • 1
  • 4
  • 12
  • This question has already an answer, http://stackoverflow.com/questions/2003505/delete-a-git-branch-both-locally-and-remotely – J.J. Hakala Jan 19 '16 at 12:59

1 Answers1

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.

alex
  • 479,566
  • 201
  • 878
  • 984