2

edit: Branch has already been deleted, not a duplicate of the linked question. Prune answer below was the answer.

Original

I pushed a branch to remote that I would like to delete. I proceeded to delete the branch. So the branch is no longer there.

git branch -r
  origin/develop
  origin/master

My local branches also has it removed.

git branch 
* develop
  master

However, if I do an ls-remote, it shows up.

git ls-remote
From git@<address>:<project>.git
<hash>  HEAD
<hash>  refs/heads/develop
<hash>  refs/heads/master
<hash>  refs/heads/portmapping
<hash>  refs/tags/3.1.3

The reference in question is portmapping. It's the branch I deleted, but it's showing up as a reference still. How do I remove this?

quickblueblur
  • 168
  • 1
  • 12
  • 1
    Possible duplicate of [How to delete a Git branch both locally and remotely?](http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely) – Kevin M Granger Feb 02 '17 at 15:03

1 Answers1

2

You need to cleanup remote deleted branch.

$ git remote prune origin
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73