您的位置:首页 > 其它

delete master error(git push origin :master)

2014-07-11 12:04 477 查看

Allgoodsofar.Wenextwanttodeletethebranchongithub.However,ifwedothisthenaiveway:
gitpushorigin:master
wejustgetanerrorlikethis:
remote:error:refusingtodeletethecurrentbranch:refs/heads/master
Togit@github.com:matthew-brett/datarray.git
![remoterejected]master(deletionofthecurrentbranchprohibited)
error:failedtopushsomerefsto'git@github.com:matthew-brett/datarray.git'
Thatisbecausegithubislookingatthemasterbranchtoprovidethewebcontentwhenyoubrowsethatrepository.Sowefirsthavetomakegithublookatourplaceholderbranchinstead,thendeletemaster.Firstpushuptheplaceholderbranch:
gitcheckoutplaceholder#ifnotonplaceholderalready
gitpushoriginplaceholder
Thensetplaceholdertobethegithubdefaultbranch.Gotothemaingithubpageforyourforkedrepository,andclickonthe“Admin”button.There’sa“Defaultbranch”dropdownlistnearthetopofthescreen.Fromthere,selectplaceholder.OntheinterfaceI’mlookingat,agreentickappearsabovethedropdownlist.Nowyoucando(fromthecommandline):
gitpushorigin:master
and-nomasterbranch...

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: