首页 > 解决方案 > 没有什么可以比较的。main 和 master 是完全不同的提交历史

问题描述

我有这些:

(fashcomp) [jalal@goku fashion-compatibility]$ git push --set-upstream origin master
Counting objects: 50, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (50/50), 22.72 MiB | 8.95 MiB/s, done.
Total 50 (delta 16), reused 0 (delta 0)
remote: Resolving deltas: 100% (16/16), done.
remote: 
remote: Create a pull request for 'master' on GitHub by visiting:
remote:      https://github.com/monajalal/fashion_compatibility/pull/new/master
remote: 
To https://github.com/monajalal/fashion_compatibility.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

(fashcomp) [jalal@goku fashion-compatibility]$ git branch -a
* master
  remotes/origin/master

(fashcomp) [jalal@goku fashion-compatibility]$ git fetch --all --tags
Fetching origin

我看到了: 在此处输入图像描述

和: 在此处输入图像描述

但是,我没有看到任何请求的地方。如何使 master 成为具有代码的实际分支并摆脱 main ?

在此处输入图像描述 在此处输入图像描述

标签: gitgithubgit-branchpull-request

解决方案


在此处输入图像描述

鉴于该main分支没有显示在终端中,使用 GitHub UI 对我来说是诀窍。

设置 --> 分支 --> 默认分支 --> 更改为预期的分支

归功于https://stackoverflow.com/a/14551480/2414957


推荐阅读