用 git bundle 离线传输仓库
把整个仓库(含历史)打包成单个文件。
运行 git bundle create repo.bundle --all,把所有引用打包进一个文件。
01命令
命令
$ git bundle create repo.bundle --all02作用说明
bundle 是单文件包,其他机器可从中克隆或拉取,非常适合隔离网络和归档备份。它携带完整历史,并可用 git bundle verify 校验。
03风险
!注意: bundle 只包含引用与对象,不含未跟踪文件、钩子和配置;完整备份请配合其他方式。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- git-bundle documentation依据: Documents git bundle, which packages refs and objects into one file.
最后验证: 2026-10-13 · 分类: 开发者