Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
删除github分支_Git_Github_Branch - Fatal编程技术网

删除github分支

删除github分支,git,github,branch,Git,Github,Branch,可能重复: 首先,我阅读了如何删除分支,但由于某些原因,我的项目无法进行: 当你第一次进入这里,你会看到一些文件10个月前在一个分支。我不知道这个分支是如何创建的,也不知道为什么会首先显示它,但我想删除它,但这不起作用 Balutas-MacBook-Pro:sdk.ralcr Cristi$ git push origin --delete gh-pages fatal: 'origin' does not appear to be a git repository fatal: The r

可能重复:

首先,我阅读了如何删除分支,但由于某些原因,我的项目无法进行:

当你第一次进入这里,你会看到一些文件10个月前在一个分支。我不知道这个分支是如何创建的,也不知道为什么会首先显示它,但我想删除它,但这不起作用

Balutas-MacBook-Pro:sdk.ralcr Cristi$ git push origin --delete gh-pages
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

我只想要主分支。

尝试使用
git branch-d
,它应该允许您删除一个功能分支

(尽管通常在删除分支之前调用
git merge
,以合并分支)

要删除远程服务器上的分支,请执行以下操作:

git push origin :<feature-branch>
git推送原点:

要删除远程分支,必须按如下方式执行:

git push <remote> :<branch>
# example
git push origin :gh-pages

另外,请确保您的远程URL是可写的。使用
git
协议是只读的,因此您需要选择
ssh
协议。(还应使用
https
url)

我在这里找到了解决方案:
我无法删除该分支,因为它是默认分支。要更改它,请转到Admin,这里有一个下拉列表。

您可以使用git remote吗?也许你的遥控器不是原点…似乎不是,但哪一个是我的回购?我在下面发布了结果。ls-remote给了我这个。Balutas MacBook Pro:sdk.ralcr Cristi$git ls远程git@github.com:ralcr/sdk.ralcr.git 75e1db961aa1d2377e6f7c35542d7ee3a53712a1d2377e6f7c35542d7ee3a53712a0 refs/heads/gh页面8edf43db60646c5c2f026bae8c229763d5f98 refs/heads/master抱歉,这只是
git remote
ls remote
用于列出远程分支、标记和其他引用。(编辑)好的,git remote给了我一些其他信息:ralcr但仍然不工作:Balutas MacBook Pro:sdk.ralcr Cristi$git push ralcr:gh pages remote:错误:拒绝删除当前分支:refs/heads/gh pages togit@github.com:ralcr/sdk.ralcr.git![远程拒绝]gh页面(禁止删除当前分支)错误:无法将某些引用推送到'git@github.com:ralcr/sdk.ralcr.git'Oh,如果
.git/config
git://
协议是只读的),你应该检查一下你在远程设备上使用了一个可写的url/协议。如果这是好的,那么您应该检查您是否真的拥有对回购协议的写访问权。是你自己的吗?
git remote