模板网站与定制网站的优缺点,谷歌关键词排名查询,我想给图书网站做代理,长沙品质网站建设优点背景
repo是Google开发的用于基于git管理Android版本库的一个工具#xff0c;管理多个Git仓库的工具#xff0c;它可以帮助您在一个代码库中管理多个Git仓库的代码。其在鸿蒙操作系统中大量使用。下面我们就介绍repo在wsl中的安装部署。
安装方法
使用中国科技大学资源
脚本i…背景
repo是Google开发的用于基于git管理Android版本库的一个工具管理多个Git仓库的工具它可以帮助您在一个代码库中管理多个Git仓库的代码。其在鸿蒙操作系统中大量使用。下面我们就介绍repo在wsl中的安装部署。
安装方法
使用中国科技大学资源
脚本install_repo.sh
mkdir -p ~/.bin/repo
git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo ~/.bin/repo
chmod x ~/.bin/repo/repo
echo export PATH~/.bin/repo:$PATH /root/.bashrc
source ~/.bashrc脚本执行后重开终端。验证
rootDESKTOP-UKR8O1E:~# repo --version
repo not installed
repo launcher version 2.54(from /root/.bin/repo/repo)
git 2.34.1
Python 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]
OS Linux 5.10.16.3-microsoft-standard-WSL2 (#1 SMP Fri Apr 2 22:23:49 UTC 2021)
CPU x86_64 (x86_64)
Bug reports: https://issues.gerritcodereview.com/issues/new?component1370071使用清华大学资源
脚本install_repo.sh
mkdir -p ~/.bin/repo
git clone https://mirrors.tuna.tsinghua.edu.cn/git/git-repo ~/.bin/repo
chmod x ~/.bin/repo/repo
echo export PATH~/.bin/repo:$PATH /root/.bashrc
source ~/.bashrc脚本执行后重开终端。验证省略。
使用问题集锦
repo init 提示“fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle“
rootDESKTOP-R500S71:/home/work# repo init -u https://gitee.com/ark-standalone-build/manifest.git -b master
Downloading Repo source from https://gerrit.googlesource.com/git-repo
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out
fatal: cloning the git-repo repository failed, will remove .repo/repo原因国内网络限制无法访问https://gerrit.googlesource.com/git-repo/clone.bundle
解决方法
替换脚本replace_repo_url.sh替换REPO_URL 内容为:https://mirrors.tuna.tsinghua.edu.cn/git/git-rep
#!/bin/bash# 查找repo路径
REPO_PATH$(which repo)if [ -z $REPO_PATH ]; thenecho 错误未找到repo命令exit 1
fi# 备份原始文件
BACKUP_PATH${REPO_PATH}.bak
echo 备份原始文件到 ${BACKUP_PATH}...
sudo cp $REPO_PATH $BACKUP_PATH# 执行替换操作
echo 执行URL替换...
sudo sed -i s|https://gerrit.googlesource.com/git-repo|https://mirrors.tuna.tsinghua.edu.cn/git/git-repo|g $REPO_PATHif [ $? -eq 0 ]; thenecho 替换成功完成!
elseecho 替换过程中出现错误已恢复备份sudo mv $BACKUP_PATH $REPO_PATHexit 1
fi