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]

相关推荐
4***V2022 小时前
GitLab Pages配置
git·gitlab·github
CelineCoding2 小时前
git 处理异常操作
git
E***q5393 小时前
Git版本控制常见问题
git
sulikey9 小时前
从入门到精通:如何自己编写高质量的 .gitignore(面向工程实践)
git·gitee·编辑器·gitlab·github·gitignore·gitattributes
青靴11 小时前
轻量级 CI/CD:Git Hooks 自动部署 Node.js 应用(CICD-demo)
git·ci/cd·node.js
哟哟耶耶13 小时前
git-git cherry-pick(从分支挑选特定提交-哈希值)更改应用到当前分支
git
无限进步_14 小时前
C语言动态内存管理:掌握malloc、calloc、realloc和free的实战应用
c语言·开发语言·c++·git·算法·github·visual studio
程序员馨馨19 小时前
git常用命令学习以及冲突解决
git·功能测试·学习
1***81531 天前
Git游戏开发案例
git
likuolei1 天前
Git 工作区、暂存区和版本库
数据库·git