How can I remove a branch which gerrit show HEAD on it?

1,932 views
Skip to first unread message

Chunlin Zhang

unread,
Oct 11, 2011, 10:54:30 PM10/11/11
to Repo and Gerrit Discussion
I want to remove a master branch in a gerrit git project,but got err:

zhangclb@zhangclb2:/media/t/Browser$ git push origin :master
To sma:/platform/packages/apps/Browser.git
! [remote rejected] master (branch is currently checked out)
error: failed to push some refs to 'sma:/platform/packages/apps/Browser.git'

And gerrit show that the HEAD branch is on master branch(see the
attach sceenshot),I think it maybe the reason can not be remove,but I
do not exactly understand it,can someone tell me how to do with this
error ?
Thanks!

2011-10-12_104731.jpg

Edwin Kempin

unread,
Oct 12, 2011, 1:52:03 AM10/12/11
to Chunlin Zhang, Repo and Gerrit Discussion
Hi,

the central repository managed by Gerrit is a bare repository. The
branch to which its HEAD points is the default branch that the users
will get after cloning.
It is not possible to delete the branch to which HEAD points. Hence in
order to delete it you first need to make HEAD point to another
branch. If you have access to the remote bare repository, you can do
this by 'git symbolic-ref HEAD refs/heads/mybranch' as described here
[1].

Best regards,
Edwin

[1] http://feeding.cloud.geek.nz/2008/12/setting-default-git-branch-in-bare.html

2011/10/12 Chunlin Zhang <zhangc...@gmail.com>:

> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>

Reply all
Reply to author
Forward
0 new messages