某一次听信了某些人推荐的阿里云的github加速服务,将一些项目的地址从github.com改成了github.com.cnpmjs.org

然后……现在github.com.cnpmjs.org域名解析没有了

再一次加深了我对于阿里巴巴这个公司不靠谱这个概念的印象,也不想写shell再遍历.git/config文件再去替换了,直接通过全局配置来搞定

解决方案

方案1: 执行git config --global url."https://github.com/".insteadOf "https://github.com.cnpmjs.org/"

方案2: 编辑~/.gitconfig文件,增加内容

1
2
3
# github.com.cnpmjs.org失效,映射成github
[url "https://github.com/"]
	insteadOf = https://github.com.cnpmjs.org/