git之fatal: unable to access 'https://git.oschina.net/pcmpcs/library.git/': Could not resolve host问题
·
今天想把项目放到github上,发现github创建私有的项目要收取每月7美元,所以干脆放到了国内的代码托管仓库git.oschina.cn上了。
但是遇到如问题:fatal: unable to access ‘https://git.oschina.net/pcmpcs/library.git/‘: Could not resolve host: git.oschina.net
问题原因:
我以前用的是ssh地址做的远程通信地址,而这次是用的是https,因为很久没用,所以忘记了以前是用ssh的了。
解放办法如下:
$git commit -v //查看当前远程服务器地址
发现是ssh的,所以我用https地址一直报错。
做如下修改:
通过如上命令修改了地址方式,再次通过
git remote -v 发现已经变成了https协议了。
OK,可以正常push了。
参考链接
更多推荐


所有评论(0)