当前位置:   article > 正文

git push或者git push -u origin “master“报错无法连接到服务器,导致不能push到码云_git push -u origin master没反应

git push -u origin master没反应

项目场景:

git 不能推送到码云上


问题描述

文件可以放在暂存区,但是只要输入git push -u origin "master"命令就会报错一下情况:

fatal: unable to access 'https://xxx.git/': Failed to connect to xxx port xxx after 2042 ms: Couldn't connect to server 

原因分析:

设置了错误的 http 代理导致的

Git 中的 http 代理配置可以通过 git config 命令进行设置和修改。如果不小心将错误的代理配置了全局 http 代理,那么在进行 Git 操作时就可能会出现连接问题。


解决方案:

1.查看是否使用了代理

git config --global http.proxy

2.取消代理

git config --global --unset http.proxy

最后我可以push到码云了。

如果拉取的时候有报错提示Can't update(master has no tracked branch),可执行以下操作

git push --set-upstream origin master

问题解决了记录一下,解决办法参考的博主链接如下:

https://blog.csdn.net/weixin_52160685/article/details/130342359?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522168948358516800185840061%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=168948358516800185840061&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-130342359-null-null.142^v88^control_2,239^v2^insert_chatgpt&utm_term=%20Failed%20to%20connect%20to%20127.0.0.1%20port%2015732%20after%202035%20ms%3A%20Couldnt%20connect%20to%20server&spm=1018.2226.3001.4187

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/476074
推荐阅读
相关标签
  

闽ICP备14008679号