Linux command
git-bundle 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create bundle of entire repository
git bundle create [repo.bundle] --all
Create bundle of branch
git bundle create [branch.bundle] [branch]
Create bundle since commit
git bundle create [recent.bundle] [commit]..HEAD
Verify bundle
git bundle verify [repo.bundle]
Clone from bundle
git clone [repo.bundle] [directory]
List bundle contents
git bundle list-heads [repo.bundle]
说明
git bundle creates and manipulates bundle files for transferring repository data offline. Bundles are portable binary archives containing Git objects and references, functioning as standalone repository snapshots. The primary use case is sharing repository data without network access, such as air-gapped environments or slow connections. Bundles can contain entire repositories or specific branches and commit ranges. They act as read-only remotes when cloned or fetched from. Unlike archives, bundles preserve Git history and can be incrementally fetched from. They're verified cryptographically to ensure data integrity. Common workflows include creating bundles on one machine, physically transferring them, and cloning or fetching on another machine.
参数
- --all
- Include all refs.
FAQ
What is the git-bundle command used for?
git bundle creates and manipulates bundle files for transferring repository data offline. Bundles are portable binary archives containing Git objects and references, functioning as standalone repository snapshots. The primary use case is sharing repository data without network access, such as air-gapped environments or slow connections. Bundles can contain entire repositories or specific branches and commit ranges. They act as read-only remotes when cloned or fetched from. Unlike archives, bundles preserve Git history and can be incrementally fetched from. They're verified cryptographically to ensure data integrity. Common workflows include creating bundles on one machine, physically transferring them, and cloning or fetching on another machine.
How do I run a basic git-bundle example?
Run `git bundle create [repo.bundle] --all` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --all do in git-bundle?
Include all refs.