Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
623 views
in Technique[技术] by (71.8m points)

git - Difference Between Main Branch and Master Branch in Github?

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.

enter image description here

enter image description here

But when I entered command

git push origin main

all files where added to my repository.

but when I do

git push origin 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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: https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/.

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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...