windows 安装repo
前置条件
1、git for windows 安装好。
2、python3安装好,并配置到环境变量
下载最新的repo工具
repo命令安装
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+rx ~/bin/repo
repo工具安装
mkdir ~/repo
cd ~/repo
git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
workspace 搭建
mkdir ~/workspace
cd ~/workspace
mkdir .repo;cd .repo
cp ~/repo/git-repo repo -rf; cd ..
repo init -u git@xxx:xxx.git -b xxx --repo-url=https://github.com/esrlabs/git-repo.git
repo sync
- 上述命令关键就在 --repo-url=https://github.com/esrlabs/git-repo.git ,替换掉原生的repo工具链,就能成功初始化了。
- 不要忘了生成ssh的public key,在Windows下也一样:在Git Bash中执行 ssh-keygen 然后复制 ~/.ssh/id_rsa.pub 文件中的内容添加到Gerrit等源码平台上即可
repo error
1、同一个目录下切换分支或者其他仓库repo,需要删掉.repo然后重新按照workspace搭建。
2、上述命令最好在管理员运行git bash下执行
3、git push时出现git@gitlabxxxxxxx,并要求输入密码,在git里 生成putty key,并设置就可以了。
参考:https://blog.csdn.net/qq_39176597/article/details/81193077