2012-08-30 33 views
4

刪除遠程分支時,當試圖刪除遠程分支我得到以下錯誤:拒絕對git的

$ git push work :18300-018_5 
remote: Processing changes: refs: 1, done 
! [remote rejected] 18300-018_5 (can not delete references) 
error: failed to push some refs [...] 

任何想法,這是什麼意思?

回答

6

這看起來像Gerrit的答案,如function parseDelete()所示。

private void parseDelete(final ReceiveCommand cmd) { 
    RefControl ctl = projectControl.controlForRef(cmd.getRefName()); 
    if (ctl.canDelete()) { 
     // Let the core receive process handle it 
    } else { 
     reject(cmd, "can not delete references"); 
    } 
    } 

這是鏈接到push policy controlled by Gerrit

This category controls how users are allowed to upload new commits to projects in Gerrit.
Deletion of existing branches is rejected. This is the safest mode as commits cannot be discarded.

所以,除非您激活此格里特類的「強制選項」,您將無法刪除服務器上的一個分支。

0

是什麼樣的服務器?我想這不是GitHub,而是一個專門配置爲禁止分支刪除的自定義服務器。與您的系統管理員討論此問題。