android-ndk开发(11): 安装 repo 命令

1. 长话短说

mkdir ~/soft/bin
curl -L https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo

~/.pathrc 添加:

export PATH=$PATH:~/soft/bin

2. 短话长说

repo 的官方介绍页面: https://gerrit.googlesource.com/git-repo/

repo 的官方下载地址: https://storage.googleapis.com/git-repo-downloads/repo

为啥不用官方的? 因为网络不好。 如果安装了, 即便开启代理, 使用仍然报错:

➜  android-ndk repo init -u https://android.googlesource.com/platform/manifest -b master-ndk --partial-clone

Downloading Repo source from https://gerrit.googlesource.com/git-repo
致命错误:无法访问 'https://gerrit.googlesource.com/git-repo/':The requested URL returned error: 429
repo: error: "git" failed with exit status 128
  cwd: /Users/zz/work/android-ndk/.repo/repo.tmp
  cmd: ['git', 'fetch', '--quiet', '--progress', 'origin', '+refs/heads/*:refs/remotes/origin/*', '+refs/tags/*:refs/tags/*']
fatal: double check your --repo-rev setting.
fatal: cloning the git-repo repository failed, will remove '.repo/repo'

查看源码:

REPO_URL = os.environ.get("REPO_URL", None)
if not REPO_URL:
    REPO_URL = "https://gerrit.googlesource.com/git-repo"

恭喜你, 折返回到清华大学镜像: https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/

3. 参考链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值