Deleted branch in Gerrit and it is still there, in its Git repo

Viewed 6614

I started using (was forced to) Gerrit, when my project was already in progress, so I pushed "everything" to Gerrit, using git push orgin -all. Some time ago, I noticed that I also pushed some additional branch, merged into master before starting to play with Gerrit and already locally removed:

$ git branch --all
* master
  remotes/oberon/master
  remotes/origin/96-fix-key-editors-references
  remotes/origin/master

I tried to delete that remote branch, the ususal way (git push origin :remotes/origin/96-fix-key-editors-references), but I was refused by Gerrit, claiming that I don't have Push privilege with Force Push option, which is required to complete this task.

So, I went to Project > Branches in Gerrit's web UI, marked that branch and was able to delete it, by pushing Delete button (interesting: I can do something in UI, what I'm prohibited via SSH?).

I thought case is over, until I again executed git branch --all, only to find out, that Git still reports branch remotes/origin/96-fix-key-editors-references as existing (result exactly like above).

I again used git push origin :remotes/origin/96-fix-key-editors-references, just to feed my curiosity, what will happen now, and I got error message saying error: unable to delete '96-fix-key-editors-references': remote ref does not exist.

So, two questions, but actually one:

  1. How can Gerrit remove branch from web UI, not removing it from Git's repo in the same time?

  2. How can remote branch be listed on list and be undeleteable (as not existing) in the same time?

I'm new to Git and even newer to Gerrit, to I might be missing something obvsious. Sorry for that!

2 Answers
Related