【问题标题】:merge two github branches合并两个github分支
【发布时间】:2021-01-14 20:22:08
【问题描述】:

所以从 GitHub 开始,并在我的桌面上创建了一个与文件夹(即简历)同名的存储库。现在它创建了一个名为 ma​​in 的默认分支。

使用 GitHub 文档 (https://gist.github.com/mindplace/b4b094157d7a3be6afd2c96370d39fad),我将代码推送到 GitHub 中的同一存储库。

现在我的 GitHub 存储库中有两个分支(ma​​inma​​ster)。我尝试使用 Pull Request 合并这两个分支,但 GitHub 说 那里在两个分支中没有什么可比较的

我想让 ma​​ster 作为我唯一的分支。我能做些什么?请帮忙。

这是回购的链接https://github.com/Ankit29Git/resume.git

【问题讨论】:

    标签: git github github-pages


    【解决方案1】:

    你可以从远程删除主分支。

    git push origin --delete main
    

    简而言之,您可以关注此https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/

    【讨论】:

    • 嗨普拉克。这是行不通的。 $ git push origin --delete main To https://github.com/Ankit29Git/resume.git ! [remote rejected] main (refusing to delete the current branch: refs/heads/main) error: failed to push some refs to 'https://github.com/Ankit29Git/resume.git'
    • 先push master,然后去github配置你的仓库的“默认分支”为master,之后就可以删除了。您可以从分支概览页面更改此设置,地址为 https://github.com/USERNAME/REPONAME/branches
    • 感谢 Lasse 和 Pulak
    • 是的,在删除主分支之前,您必须将 master 作为默认分支。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-30
    • 1970-01-01
    • 2016-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-18
    相关资源
    最近更新 更多