码迷,mamicode.com
首页 > 其他好文 > 详细

delete master error(git push origin :master)

时间:2014-07-16 19:33:09      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:http   os   width   for   io   div   



All good so far. We next want to delete the branch on github. However, if we do this the naive way:

git push origin :master

we just get an error like this:

remote: error: refusing to delete the current branch: refs/heads/master
To git@github.com:matthew-brett/datarray.git
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to ‘git@github.com:matthew-brett/datarray.git‘

That is because github is looking at the master branch to provide the web content when you browse that repository. So we first have to make github look at our placeholder branch instead, then delete master.

First push up the placeholder branch:

git checkout placeholder # if not on placeholder already
git push origin placeholder

Then set placeholder to be the github default branch. Go to the main github page for your forked repository, and click on the “Admin” button.

bubuko.com,布布扣

There’s a “Default branch” dropdown list near the top of the screen. From there, select placeholder. On the interface I’m looking at, a green tick appears above the dropdown list. Now you can do (from the command line):

git push origin :master

and - no master branch...

 

 

 

delete master error(git push origin :master),布布扣,bubuko.com

delete master error(git push origin :master)

标签:http   os   width   for   io   div   

原文地址:http://www.cnblogs.com/qinyan20/p/3837431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!