repo 安装
Windows 安装
1. 安装Python3,过程中一定要勾选将Python加入到Windows环境变量中;
2. 使用git clone,将https://mirrors.tuna.tsinghua.edu.cn/git/git-repo克隆至本地任意目录;
3. 从2中克隆完成的git-repo目录,找到repo文件
4. 将3中的repo添加到Windows的环境变量中
5. 打开3中的repo,找到REPO_URL,将“=”号后面的地址替换为https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
6. 使用repo init命令初始化我们的git目录
7. init成功后,使用repo sync命令,同步最新代码
使用repo
1 初始化repo仓库
需要切换为自己的名字的地址
例 repo init -u ssh://ma.jianjun@10.170.133.161:29418/IVI23/manifest.git -m manifest.xml
repo init -u ssh://xxx@10.170.133.161:29418/IVI23/manifest.git -m manifest.xml
2 同步代码
repo sync
3 为所有git仓库拉取远端origin/dev并创建本地dev分支
repo start --all dev
Mac 安装
1. 创建repo脚本存放路径,并配置环境变量
mkdir ~/bin
PATH=~/bin:$PATH
2. 下载 Repo 工具,并确保它可执行:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
上面是Google的repo文档,由于在墙外,所以请使用下面清华大学提供的repo
# 清华大学repo
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
#修改repo权限,可以用 ‘ll ~/bin/repo’ 命令查看
chmod a+x ~/bin/repo
3. 配置repo
3.1 设置manifest.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<manifest>
<remote
name="origin"
fetch="http://admin@172.16.29.213:7070/r/xxx"
revision="dev"
/>
<default
remote="origin"
revision="dev"
sync-j="4"
sync-c="true"
/>
<project name="IVI23_Launcher" path="xxx" />
</manifest>