【发布时间】:2012-08-25 21:10:38
【问题描述】:
我需要删除一个 master 分支,但事实证明这很难。我只想清理那个分支并开始新的。我正在从 dev 分支中删除。我希望 GitHub 上的 master 干净。
# git push origin --delete master
> To https://github.com/mymasterb.git ! [remote rejected] master
> (deletion of the current branch prohibited) error: failed to push some
> refs to 'https://github.com/mymaster.git'
我如何简单地从新开始我的主人?
【问题讨论】:
-
你所说的“新鲜的石板”是什么意思?您希望您的主分支完全为空,但您希望所有其他分支仍然存在?
-
How do I change a Git remote HEAD to point to something besides "master" 的可能副本。重复,因为它说
deletion of the current branch prohibited很明显,必须更改当前分支,这就是接受的答案所解释的。这正是建议的副本中所解释的内容,包括由于标签而导致的 github 解决方案。