问题描述

提示:这里描述项目中遇到的问题:

git push --set-upstream origin master时,超时失败,显示如下错误:

connect to host git.acwing.com port 22:
Connection timed out fatal: Could not read from remote repository.  
Please make sure you have the correct access rights and the repository exists.

解决方案:

使用https协议,不要使用ssh协议

在你的git init的本地仓库目录,执行命令 git config --local -e
然后把里面的url配置项从git格式url = git@git.acwing.com:username/xx.git
修改为https格式url = https://git.acwing.com/username/xx.git
然后再执行git push --set-upstream origin master
输入git.acwing的账号名和密码就能成功git push到云端了。
**可以直接修改为https格式url = https://username:passwd@git.acwing.com/username/xx.git**这样就不用每次push都重新输入账号密码了

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐