Skip to content

Commit

Permalink
Merge branch 'kh/bundle-docs' into seen
Browse files Browse the repository at this point in the history
* kh/bundle-docs:
  Documentation/git-bundle.txt: discuss naïve backups
  Documentation/git-bundle.txt: mention --all in spec. refs
  Documentation/git-bundle.txt: mention full backup example
  • Loading branch information
ttaylorr committed Oct 29, 2024
2 parents 743a18c + c4ac5fa commit 26f62af
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Documentation/git-bundle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ 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.
repository (`git bundle create <file> --all`), 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
Expand Down Expand Up @@ -132,7 +132,7 @@ SPECIFYING REFERENCES
---------------------

Revisions must be accompanied by reference names to be packaged in a
bundle.
bundle. Alternatively `--all` can be used to package all refs.

More than one reference may be packaged, and more than one set of prerequisite objects can
be specified. The objects packaged are those not contained in the
Expand Down Expand Up @@ -203,8 +203,6 @@ It is okay to err on the side of caution, causing the bundle file
to contain objects already in the destination, as these are ignored
when unpacking at the destination.

If you want to match `git clone --mirror`, which would include your
refs such as `refs/remotes/*`, use `--all`.
If you want to provide the same set of refs that a clone directly
from the source repository would get, use `--branches --tags` for
the `<git-rev-list-args>`.
Expand Down Expand Up @@ -321,6 +319,20 @@ You can also see what references it offers:
$ git ls-remote mybundle
----------------

DISCUSSION
----------

A naive way to make a full backup of a repository is to use something to
the effect of `cp -a <repo> <destination>`. This is discouraged since
the repository could be written to during the copy operation. In turn
some files at `<destination>` could be corrupted.

This is why it is recommended to use Git tooling for making repository
backups, either with this command or with e.g. linkgit:git-clone[1].

See also linkgit:gitfaq[7], section "TRANSFERS" for a discussion of the
problems associated with file syncing across systems.

FILE FORMAT
-----------

Expand Down

0 comments on commit 26f62af

Please sign in to comment.