已解决
Ubuntu 配置repo环境
来自网友在路上 158858提问 提问时间:2023-10-10 23:22:57阅读次数: 58
最佳答案 问答题库588位专家为你答疑解惑
一. 前言
下载Android源码的时候,自己的Ubuntu电脑需要初始化repo环境,这样子你就可以使用 repo init -u ssh: repo sync 等命令下载代码, 在工作中,一般公司的代码仓 git-repo 是固定的,首次就需要把repo的初始化环境配置好,比较简单,随笔记录一下。
二. 配置步骤
1. 从清华镜像网站下载 git-repo
git clone https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
2. 根目录下创建.bin文件夹
mkdir ~/.bin
3. 拷贝git-repo文件夹中的repo 到 ~/.bin 目录下
cp git-repo/repo ~/.bin/
4. 添加执行权限
sudo chmod a+x ~/.bin/repo
5. 配置环境
export PATH=~/.bin:$PATH
echo "export PATH=~/.bin:$PATH">> ~/.bashrc
6. 配置下载代码repo地址环境
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
echo "export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'">> ~/.bashrc
三. 检查环境并下载源码
1. 执行命令查看是否配置ok
vi ~/.bashrc
可以在文件的最尾部可以看到如下,说明配置成功
export PATH=~/.bin:/home/xx/.bin:
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
2. 下载google源码,比如下载Android11源码
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-11.0.0_r17repo sync
查看全文
99%的人还看了
相似问题
猜你感兴趣
版权申明
本文"Ubuntu 配置repo环境":http://eshow365.cn/6-18629-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!