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]

相关推荐
qq_5470261798 小时前
OAuth 2.0 安全授权
git·安全·github
GOATLong9 小时前
git使用
大数据·c语言·c++·git·elasticsearch
孟陬13 小时前
别再社死了!`includeIf` 一招搞定 Git 提交者信息错乱,守护你的邮箱隐私
git·github
lyj16899714 小时前
git小乌龟如何单个文件回退及整个版本回退
git
大飞码农15 小时前
📊 开源了一个 Git 代码统计神器,解决了团队代码量统计的 N 个痛点
git·数据可视化
李拾叁的摸鱼日常15 小时前
git pull --rebase 最佳实践(含详细命令+真实案例)
git
Fang XS.16 小时前
GIT命令常用方法
git
初见00118 小时前
Git时间管理大师:Reset Current Branch to Here 全解析
git·后端
Rverdoser2 天前
制作网站的价格一般由什么组成
前端·git·github