git常见问题

2022/3/28 23:31:29

本文主要是介绍git常见问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

问题1:从github拉取代码(执行git pull origin main),报错
fatal: unable to access 'https://github.com/haleylan10/test/': OpenSSL SSL_read: Connection was reset, errno 10054

问题原因:连接问题,github经常会连接不上

解决方法:可隔段时间再试

 

问题2:执行git push origin master推送代码到github报错

error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/haleylan10/sms_text_classification.git'

问题原因:由于受到"Black Lives Matter"运动的影响,GitHub 从2020年 10 月 1 日起,在该平台上创建的所有新的源代码仓库默认被命名为 “main”,而不是原先的"master"。

解决方法:在git命令行中执行

                   git branch -m master main

                   git push origin main

 



这篇关于git常见问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程