delete master error(git push origin :master)



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 [email protected]:matthew-brett/datarray.git
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to ‘[email protected]: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.

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)

时间: 2024-08-27 10:55:34

delete master error(git push origin :master)的相关文章

git push origin master出错:error: failed to push some refs to

1.输入git push origin master 出错:error: failed to push some refs to 那是因为本地没有update到最新版本的项目(git上有README.md文件没下载下来) 本地直接push所以会出错. 2.所以本地要输入git pull 然后出现的英语提示'git pull <repository> <refspec>'显示要选择远程分支 2.就试试指定目标到远程分支 输入git pull origin 出现提示 but did n

git push origin master

touch README.mdgit initgit add README.mdgit commit -m "first commit"git remote add origin [email protected]:joojfork/Linuxyunwei.gitgit push -u origin master git remote add origin [email protected]:joojfork/Linuxyunwei.gitgit push -u origin mast

git push origin master 遇到的分支问题

我从master分支创建了一个issue1分支,做了一些修改后,使用git push origin master提交,但是显示的结果却是'Everything up-to-date', 发生问题的原因是git push origin master 在没有track远程分支的本地分支中默认提交的master分支,因为master分支默认指向了origin master 分支, 这里要使用git push origin issue1:master 就可以把issue1推送到远程的master分支了

git push origin master 报错 remote rejected] master -&gt; master (branch is currently checked out)

解决办法: 977down vote You can simply convert your remote repository to bare repository (there is no working copy in the bare repository - the folder contains only the actual repository data). Execute the following command in your remote repository folde

git push origin master 错误解决办法

一.错误代码如下: error: failed to push some refs to 'https://github.com/wbingithub/drag.git' 二.在网上搜了一下,如下写就可以了 git push -f origin master

git push origin与git push -u origin master的区别

$ git push origin 上面命令表示,将当前分支推送到origin主机的对应分支. 如果当前分支只有一个追踪分支,那么主机名都可以省略. $ git push 如果当前分支与多个主机存在追踪关系,那么这个时候-u选项会指定一个默认主机,这样后面就可以不加任何参数使用git push. $ git push -u origin master 上面命令将本地的master分支推送到origin主机,同时指定origin为默认主机,后面就可以不加任何参数使用git push了. 不带任何参

更换仓库地址后,git fetch origin master报错

1.问题描述: 今天服务器迁移了下git,于是就直接根据拷贝后的git repo创建了远程仓库,本来一切都很顺利. 服务器端执行命令报错.记录下解决过程 2.执行命令报错 $ git fetch origin master @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @ @@@@@@@@@@@@@@@@@@

推送提交(git push)

当需要同别人共享某个分支上的工作成果时,就要把它推送到一个具有写权限的远程仓库.你的本地分支并不会自动同步到远程仓库,必须要显式地推送那些你想要与别人共享的分支.这样一来,你可以使用私有分支做一些不想与别人共享的工作,而仅仅推送那些需要与别人协作的主题分支. 假设你有一个叫做modb的分支需要与其他人协作开发,你可以执行 git push (remote)(branch) $git push origin modb 上述命令实际上是一个简化的写法.Git会自动把分支名称modb扩展成 refs/

git 提交远程分支 老是提示 git push origin HEAD 问题

如上图 我本地分支 local-dev 推送远程 origin/dev 如果直接 git push , 总是报警告, 提示的 英文大致意思是 当前更新的分支 和 远程的分支不匹配, 说白了就是 [  名字不一样  local-dev  => origin/dev ] 所以把本地分支 名字 和 远程分支名字 一样即可   我把本地 分支 重命名 为 dev 就可以了 这样就没有烦人的 git push origin HEAD:dev了 成功后的图如下所示 原文地址:https://www.cnbl