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]

相关推荐
Howie Zphile14 小时前
Git 拉 NocoBase 2.0 beta(next 分支),并“每天自动更新 + 自动编译 + 自动重启”
大数据·git·elasticsearch
吕司15 小时前
Git分支管理
git
黑屋里的马16 小时前
GitExtension下载、安装
git·gitextension
Geoking.16 小时前
Git 中的 Rebase 与 Merge:原理、区别与最佳实践
git
invicinble18 小时前
一文了解git
大数据·git·elasticsearch
我命由我1234518 小时前
Git 初始化本地仓库并推送到远程仓库解读
运维·服务器·经验分享·笔记·git·学习·学习方法
爱码小白19 小时前
Git学习笔记
笔记·git·学习
skywalk816320 小时前
sudo apt upgrade git 报错
git
_运维那些事儿20 小时前
GitLabCI/CD语法
linux·服务器·git·ci/cd·gitlab·运维开发·devops
huohuopro21 小时前
git基本使用
大数据·git·elasticsearch