Github中的主分支和主分支之间的区别?

编程入门 行业动态 更新时间:2024-10-24 19:22:03
本文介绍了Github中的主分支和主分支之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在master分支上尝试了git push,但是它只显示我有新的请求请求,但是当我单击新的请求请求时,需要我比较更改,但没有显示任何将这些更改添加到存储库的选项.它只显示我所做的更改.

I tried git push on master branch but it just shows that I have new pull request but when I click on new pull request it takes me to comparing changes but doesn't show any option to add those changes into repository. It only shows changes I made.

但是当我输入命令

git push origin main

所有添加到我的存储库中的文件.

all files where added to my repository.

但是当我这样做

git push origin master

它不起作用.为什么?听说他们用main代替master.那么将来他们会删除主人吗?

it doesn't work. Why is it? I heard they are replacing master with main. So in future are they going to remove master?

推荐答案

GitHub致力于替换术语"master",使用主要"等中性术语为了避免不必要地提及奴隶制,

GitHub is working on replacing the term "master" on its service with a neutral term like "main" to avoid any unnecessary references to slavery,

您可以在此处阅读更多背景信息,以了解进行更改的原因: www.zdnet/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/.

You can read here for more background the reason for the change here: www.zdnet/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/.

关于将分支从主分支重命名为主分支,有很多准则.例如: jarv.is/notes/github-rename-master/.

About renaming your branch from master to main, there are a lot of guidelines. For example: jarv.is/notes/github-rename-master/.

git branch -m master main \ git push -u origin main \ git remote set-head origin main

更多推荐

Github中的主分支和主分支之间的区别?

本文发布于:2023-11-26 18:38:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   区别   Github

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!