[Git的使用–如何将本地项目上传到Github(三种简单、方便的方法)(二)(详解) - 腾讯云开发者社区-腾讯云 (tencent.com)](https://cloud.tencent.com/developer/article/1504684#:~:text=总结:其实只需要进行下面几步就能把本地项目上传到Github 1、在本地创建一个版本库(即文件夹),通过git init把它变成Git仓库; 2、把项目复制到这个文件夹里面,再通过git,add.把项目添加到仓库; 3、再通过git commit -m “注释内容”把项目提交到仓库;)

(53条消息) 解决办法:git错误 error: failed to push some refs to ‘https://github.com/..._bluetata的博客-CSDN博客

(53条消息) git提交或克隆报错fatal: unable to access ‘https://github.com/tata20191003/autowrite.git/‘: Failed to connec_good_good_xiu的博客-CSDN博客_git unable to access

(52条消息) 解决办法:git错误 error: failed to push some refs to ‘https://github.com/..._学学学无止境的博客-CSDN博客

Git 常用命令大全 (runoob.com)

(55条消息) Git克隆、拉取最新代码、上传代码到远程仓库_x-dragon8899的博客-CSDN博客_git 拉取最新代码

将本地项目上传的到github

打开一个文件

1、git bash here

2、git lone https://github.com/hejixing/xiaxin-web.git

3、把代码放到克隆生成的xiaxin-web文件夹里面,注意如果代码里面有git文件要删掉,因为一个项目只能有一个.git文件

4、可以通过git status 查看状态

5.代码复制到文件夹后

6、git add .

7、git commit -m "项目备注"

8、git push -u origin main

会报错fatal: unable to access 'https://github.com/xxx/autowrite.git/':
OpenSSL SSL_read: Connection was reset, errno 10054

参考

(55条消息) git提交或克隆报错fatal: unable to access ‘https://github.com/tata20191003/autowrite.git/‘: Failed to connec_good_good_xiu的博客-CSDN博客_git unable to access

9、

//取消http代理
git config --global --unset http.proxy
//取消https代理
git config --global --unset https.proxy

10、git push -u origin main ,这个命令不成功的话 可以加个-f 强制推送 git push -u -f origin main

**注意gitpush上去的文件不能大于100M,如果大于会报错**

11、git fetch –all / git pull origin master

(55条消息) Git克隆、拉取最新代码、上传代码到远程仓库_x-dragon8899的博客-CSDN博客_git 拉取最新代码

如果出现

unable to access 'https://github.com/hejixing/xiaxin.git/': Failed to connect to github.com port 443 after 21035 ms: Timed out

即拉取超时

则设置如果还超时,可以设置超时参数:

git config --global http.lowSpeedLimit 0

git config --global http.lowSpeedTime 999999

方法1:可以直接用命令行试,不要使用代理。如git clone [https://github.com/xxx/yyy](https://link.zhihu.com/?target=https%3A//github.com/xxx/yyy),观察是否还是报timeout。

方法2:如果还超时,可以设置超时参数:git config --global http.lowSpeedLimit 0 和 git config --global http.lowSpeedTime 999999。方法3:使用github加速网站 [https://gitclone.com](https://link.zhihu.com/?target=https%3A//gitclone.com) ,用命令行: git clone https://**[http://gitclone.com/](https://link.zhihu.com/?target=http%3A//gitclone.com/)**[http://github.com/xxx/yyy](https://link.zhihu.com/?target=http%3A//github.com/xxx/yyy)

最后完成拉取代码


关于git 已提交未push的情况

(55条消息) IDEA git 撤回commit(已提交未push)方法 回滚方法_ZHANG_980的博客-CSDN博客_idea git已提交未push回滚