git worktree (镜像站加速)

原因是一次想要将ros1的算法拉到ros2,所以想要在同一个目录里便捷diff。

于是这是执行过程

bash 复制代码
cd /home/ws/ws_core/src/FAST-LIVO2

# 1) 拉取走镜像
git remote set-url ros1 https://ghfast.top/https://github.com/yqmy0814/FAST-LIVO2.git

# 2) 推送回官方(避免误推到镜像)
git remote set-url --push ros1 https://github.com/yqmy0814/FAST-LIVO2.git

# 3) 确认
git remote -v
# 看到 fetch=ghfast..., push=github.com/... 就对了

# 4) 用浅/部分克隆加速拉取
git fetch --depth=1 --filter=blob:none --no-tags ros1 devel

一个扩展的git 代理选择是

bash 复制代码
git config --global url."https://ghfast.top/https://github.com/".insteadOf https://github.com/
# 需要还原时:
# git config --global --unset url."https://ghfast.top/https://github.com/".insteadOf

但我没用。

接着进行正常的编译,和正常的一模一样.

bash 复制代码
root@DW:/home/ws/ws_core# colcon list | grep -i livo
fast_livo    src/FAST-LIVO2    (ros.ament_cmake)
root@DW:/home/ws/ws_core# source /opt/ros/humble/setup.bash
root@DW:/home/ws/ws_core# colcon build
Starting >>> vikit_common
Finished <<< vikit_common [0.23s]                  
Starting >>> vikit_ros
Finished <<< vikit_ros [0.17s]                  
Starting >>> fast_livo
Finished <<< fast_livo [0.19s]                    

Summary: 3 packages finished [0.70s]

相关推荐
和你看星星2 天前
Git rerere:让重复冲突只解决一次
git
嘻嘻仙人5 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson5 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友6 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
深海鱼在掘金6 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森7 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang7 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年8 天前
Windows 中安装 git
git
深海鱼在掘金13 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc14 天前
关于Git Flow
git