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]

相关推荐
柒壹漆42 分钟前
用Python制作一个USB Hid设备数据收发测试工具
开发语言·git·python
爱吃番茄鼠骗2 小时前
git命令使用教程
git
黑牛先生4 小时前
【Git】解决远程仓库备注错误问题
git
rockmelodies6 小时前
Git冲突解决实用指南
git·git冲突
bj_zhb6 小时前
Git 回退到某个 commit
git·github
凯子坚持 c6 小时前
Git分支实战指南:如何优雅地管理版本、修复Bug并解决合并冲突
git·bug
openinstall全渠道统计6 小时前
开发者指南:广告投放系统搭建与前后端数据打通全流程
windows·git·oracle·eclipse·sqlite·github
yunianshu6 小时前
在 DevEco Studio 中查看 Git 本地更改 (Local Changes) 指南
git
脾气有点小暴6 小时前
git commit 的提交如何撤销
git
winner88817 小时前
Git撤销修改:git restore . 与 git reset --hard 万字详解
git·git reset·git restore .