Cannot delete remote branch in git

前端 未结 3 1833
借酒劲吻你
借酒劲吻你 2020-12-31 05:48

I\'d like to delete a remote branch from my central git repository. The usual advice is to do \'git push origin :branchname\' or \'git push origin :heads/branchname\'. But

相关标签:
3条回答
  • 2020-12-31 06:36

    I think this might be what the message says: the remote repository does not permit any removal of history. Consider different git hosting (if you cannot adjust the settings on what you are currently using) if you really need this functionality.

    0 讨论(0)
  • 2020-12-31 06:42

    You might have to log into your remote repository and delete the branch manually (ie - from the file system).

    0 讨论(0)
  • 2020-12-31 06:47

    Someone has enabled a hook in the remote repo that is prohibiting the delete -- this is usually done so that someone can't push a rebased branch into the repo. (I maintain a fairly large collection of git repositories and they are all configured this way, although not with a hook.)

    Look in the hooks/ directory in the remote repository. There will be a script named "update"; this is what's refusing to let you delete the branch.

    0 讨论(0)
提交回复
热议问题