Bundle the repository

hustnzj發表於2022-09-09

Bundle the repository

DESCRIPTION

Create, unpack, and manipulate "bundle" files. Bundles are used for the
"offline" transfer of Git objects without an active "server" sitting on
the other side of the network connection.

They can be used to create both incremental and full backups of a
repository, and to relay the state of the references in one repository to
another.

Git commands that fetch or otherwise "read" via protocols such as ssh://
and https:// can also operate on bundle files. It is possible git-
clone(1) a new repository from a bundle, to use git-fetch(1) to fetch
from one, and to list the references contained within it with git-ls-
remote(1). There’s no corresponding "write" support, i.e.a git push into
a bundle is not supported.

See the "EXAMPLES" section below for examples of how to use bundles.

Examples

See here.

Note:

  1. The bundle will only include a branch that is master in this case.
  2. In the resulting repository, git fetch mybundle master:localRef will create a new branch named localRef.

Conclusion

Git-bundle is a great way to backup entire Git repositories (not just an isolated snapshot like git archive) and it also let you share changes without a network connection.

本作品採用《CC 協議》,轉載必須註明作者和本文連結
日拱一卒

相關文章