Github 主分支和主分支的区别? [英] Difference Between Main Branch and Master Branch in 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.那么他们将来会移除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,
您可以在此处阅读有关更改原因的更多背景信息 这里:
You can read here for more background the reason for the change here:
关于将分支从 master 重命名为 main,有很多指南.例如:
About renaming your branch from master to main, there are a lot of guidelines. For example:
git branch -m master main
git push -u origin main
git remote set-head origin main
这篇关于Github 主分支和主分支的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!