首先:现在是牛客网上的git不好使,上传不上去。建议使用github
再次:现在github强制使用SSH上传。
我出现问题的前提:
我已在idear上配置好git;
已生成key;
通过git cmd 可以成功上传代码;
但通过IDEAR上传不成功。
依次出现过以下错误:
问题1:
push failed: fatal: unable to access ‘https://github.com/***port 443: Timed out
解决办法:
设置跳过SSL验证
直接打开git cmd,然后直接运行该语句
git config --global http.sslVerify false
问题2:
atal: unable to access 'https://github.com/GaomyThinker/mall-java.git/': OpenSSL SSL_read: Connection was reset, errno 10054
解决办法:
这里这个错误 具体不知道什么原因导致的,但是通过查询,说是可能是因为设置了http代理,则需要去除代理
git config --global --unset http.proxy
git config --global --unset https.proxy
**注意:**我通过网上的各种操作,一直在idear上都无法成功上传代码,最后没有办法了,通过git cmd页面进行push。
在进行push的过程中,出现以下错误信息:
好像是我的项目中只有master这一个分支,没有其他分支了,我的上传语句对应该采用以下命令
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
直接将系统提示的git命令写上,就发现上传成功了。
当然此部分命令 应当在 你需要上传的项目目录下进行。比如我的目录:
上传成功后,我又尝试通过idear进行git push,
就可以成功上传了!
稀里糊涂,不知道怎么解决的,如果idear一直解决不好的话,直接通过git cmd进行上传,排除git存在的问题,也是一种新奇思路。
最后,从github上看到的,我们可以直接复制ssh的路径,这样push的时候就直接通过ssh,可以避免问题1,2的出现。