国内repoinit在执行时会报类似下面的错误:fatal:Cannotgethttps://gerrit.googlesource.c...fatal:error[Errno110]Connectiontimed这是因为repoinit会从googlesource获取最新的repo。但是这个网站在中国是无法访问的。解决方法如下:使用国内镜像站https://mirrors.tuna.tsinghua...下载curlhttps://mirrors.tuna.tsinghua.edu.cn/git/git-repo-orepochmod+x为方便起见,可以将其复制到您的PATH中。在更新仓库运行期间,它会尝试访问官方git源来更新自己。如果你想使用tuna的镜像源进行更新,可以复制以下内容到你的~/.bashrcexportREPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'and重启终端查看REPO_URL是否生效。
