項(xiàng)目場(chǎng)景:
git 不能推送到碼云上
問(wèn)題描述
文件可以放在暫存區(qū),但是只要輸入git push -u origin "master"命令就會(huì)報(bào)錯(cuò)一下情況:
fatal: unable to access 'https://xxx.git/': Failed to connect to xxx port xxx after 2042 ms: Couldn't connect to server
原因分析:
設(shè)置了錯(cuò)誤的 http 代理導(dǎo)致的
Git 中的 http 代理配置可以通過(guò)?git config
?命令進(jìn)行設(shè)置和修改。如果不小心將錯(cuò)誤的代理配置了全局 http 代理,那么在進(jìn)行 Git 操作時(shí)就可能會(huì)出現(xiàn)連接問(wèn)題。
解決方案:
1.查看是否使用了代理
git config --global http.proxy
2.取消代理
git config --global --unset http.proxy
最后我可以push到碼云了。
如果拉取的時(shí)候有報(bào)錯(cuò)提示Can't update(master has no tracked branch),可執(zhí)行以下操作
git push --set-upstream origin master
問(wèn)題解決了記錄一下,解決辦法參考的博主鏈接如下:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-743212.html
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文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-743212.html
到了這里,關(guān)于git push或者git push -u origin “master“報(bào)錯(cuò)無(wú)法連接到服務(wù)器,導(dǎo)致不能push到碼云的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!