近一直想下载android的源码看看,但是按照官方的文档下载,遇到了问题。
在执行的curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo的时候不能下载repo;
在网上查了大量资料,找到了可行的办法:
将 curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
改成curl http://git-repo.googlecode.com/files/repo-1.12 > ~/bin/repo ,这样就可以下载repo
或
将 curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
改成 curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo ,这样就可以下载repo了。
尝试了上面两种方法都不行!使用下面这个国内资源就可以了
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
可参考下面这个博客:
https://blog.csdn.net/ljz0929/article/details/122928242
https://blog.csdn.net/usstmiracle/article/details/125296679