repo国内安装

repo是个python脚本用于管理多个git仓库。

  • 正常安装repo的过程为
shell 复制代码
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo && chmod a+x /usr/bin/repo

其作用就是获取repo脚本内容输出到/usr/bin/repo中,然后给/usr/bin/repo赋予可执行权限。


  • 国内安装repo过程
    由于国内无法访问https://storage.googleapis.com/git-repo-downloads/repo,因此需要改用国内镜像,这里使用清华镜像
shell 复制代码
curl -L https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o /usr/bin/repo && chmod a+x /usr/bin/repo

每次在执行repo指令的时候repo都要检测自己是否需要更新,repo会读取环境变量REPO_URL去获取更新地址。默认还是访问google,因此我们需要设置REPO_URL的值,让其指向国内镜像地址。

~/.bashrc中添加export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

重启终端就可以正常使用repo了。

相关推荐
sean9082 个月前
git filter-repo(优秀的 git repo 历史重写工具) 实战
git·repo·工具
钱塘江渔夫6 个月前
【Ubuntu22.04】repo安装方法
repo·openhamony
林政硕(Cohen0415)1 年前
Repo管理
git·嵌入式·repo
橘长_1 年前
repo仓库转移到自己本地的git服务器
服务器·git·repo·正点原子
bob_young1 年前
repo 命令大全详解(第十一篇 repo init)
repo
bob_young1 年前
repo 命令大全详解(第十七篇 repo smartsync)
repo
江上清风山间明月1 年前
repo 查看指定日期内,哪些仓库有修改,具体的修改详情
git·repo·记录·日期·修改·作者·详情
江上清风山间明月1 年前
git标签、repo如何打tag
git·repo·标签·tag·打tag·打标签