GitLib:ssh: connect to host x.x.x.x port 22: Connection timed out fatal: 无法读取远程仓库。请确认您有正确的访问权

GitLib链接异常:

ssh: connect to host x.x.x.x port 22: Connection timed out 
fatal: 无法读取远程仓库。
请确认您有正确的访问权

先查看一下配置是否正确

git config --list

备注:remote.origin.url建议使用http开头,非git@开头,因为有些公司不开放gitlab对应的22端口,或该端口上传会不稳定

修改remote.origin.url 重置远程跟踪链接

git remote set-url origin http://git.###.com/###-front-xxx.git
git push --set-upstream origin master

其他相关配合查询git命令
查询远程分支版本及链接

git remote -v

原因:就是使用了git@的链接,换成http@就好了

猜你喜欢

转载自blog.csdn.net/u010274449/article/details/132602698