0


Git error:‘fatal: Couldn‘t find remote ref master‘

如果出现该错误提示,可能是因为使用了旧命令:

   git pull origin master

master现在被认为是有种族歧视的,github将其换成了main,所以现在使用pull可以写为:

   git pull origin main

如需要将已有repos的

master

换为

main

,可依照以下步骤:

  • 1-重命名本地分支: git branch -m master main
  • 2-重命名远程分支 git checkout main git push -u origin main
  • 3-删除远程分支master`````` git push origin --delete master
  • 4-告知团队中的其他人更新他们的本地库,方法如下: # Switch to "master" branch git checkout master # Rename "master" branch to "main" git branch -m master main # Get latest commits and branches from remote git fetch # Remove existing connection with "master" git branch --unset-upstream # Create connection with new "main" branch git branch -u origin/main
标签: git github

本文转载自: https://blog.csdn.net/m0_37894398/article/details/127055637
版权归原作者 Dr Turing 所有, 如有侵权,请联系我们删除。

“Git error:‘fatal: Couldn‘t find remote ref master‘”的评论:

还没有评论