Windows下安装repo

安装步骤

安装git

官网下载安装最新的git for windows,我安装的是Git-2.32.0-64-bit.exe。配置环境变量。一般安装完成会自动配置环境变量。

安装python3

官网下载python3进行安装。Python 3在安装的时候勾选Add path会自动配置环境变量。我安装的是python-3.9.5-amd64.exe。

安装repo

  1. Git bash中下载repo工程
mkdir ~/bin
# 1. 下载脚本文件,推荐直接通过google地址下载,需科学上网
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# 或者直接在Github上下载
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo
# 2. 下载repo.cmd
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > ~/bin/repo.cmd
chmod a+rx ~/bin/repo
  1. 添加~/bin/repo至系统环境变量
    「系统属性」-「环境变量」-「系统变量」-「Path」下新增 %USERPROFILE%\bin

参考资料