【问题标题】:GitHub/git - how to make only one branch (gp-pages) and delete other branchesGitHub/git - 如何只创建一个分支(gp-pages)并删除其他分支
【发布时间】:2013-08-08 16:37:15
【问题描述】:

我有带有站点的 git 存储库,即在 GitHub 页面上发布(gh-pages 分支)。

现在我只想拥有一个分支gh-pages 并删除所有其他分支(本地和服务器上)

弹出的答案是How do I delete a Git branch both locally and remotely?,但是在做的时候

git push origin --delete master

远程:错误:拒绝删除当前分支:refs/heads/master 致https://github.com/Nodeclipse/www.nodeclipse.com.git ! [remote denied] master(禁止删除当前分支) 错误:未能将一些参考推送到'https://github.com/Nodeclipse/www.nodeclipse .com.git'

使用 Eclipse EGit,我可以在 UI 中删除,但它仍保留在服务器上,并且在 pull 回来后。

【问题讨论】:

    标签: git github git-branch


    【解决方案1】:

    您可能需要将远程仓库中的默认分支更改为 master 分支以外的其他内容:

    【讨论】:

    • 原来是这样
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-24
    • 1970-01-01
    • 2017-08-14
    • 2023-03-22
    • 2020-12-01
    • 1970-01-01
    相关资源
    最近更新 更多