When I do git ls-remote
to my remote repository it shows:
HEAD
refs/heads/BranchA
refs/heads/master
refs/remotes/origin/BranchA
refs/remotes/origin/master
How can I delete the last two entries?
When I do git ls-remote
to my remote repository it shows:
HEAD
refs/heads/BranchA
refs/heads/master
refs/remotes/origin/BranchA
refs/remotes/origin/master
How can I delete the last two entries?
You can do this by pushing an empty ref, so:
git push origin :BranchA :master
will do the trick. If you follow that with a 'git fetch --prune origin', then they won't show up in 'git branch -a' either.
Simplest answer I found on SO itself and it worked like a charm.
git push repository :refs/remotes/origin/BranchA
git push repository :refs/remotes/origin/master