Skip to content

Commit c65c75b

Browse files
committed
Merge branch 'kh/bundle-docs' into jch
Documentation improvements to more prominently call out the use of '--all' when creating bundles. * 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
2 parents 2f42bd7 + c4ac5fa commit c65c75b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Documentation/git-bundle.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ the "offline" transfer of Git objects without an active "server"
2323
sitting on the other side of the network connection.
2424

2525
They can be used to create both incremental and full backups of a
26-
repository, and to relay the state of the references in one repository
27-
to another.
26+
repository (`git bundle create <file> --all`), and to relay the state of
27+
the references in one repository to another.
2828

2929
Git commands that fetch or otherwise "read" via protocols such as
3030
`ssh://` and `https://` can also operate on bundle files. It is
@@ -132,7 +132,7 @@ SPECIFYING REFERENCES
132132
---------------------
133133

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

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

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

322+
DISCUSSION
323+
----------
324+
325+
A naive way to make a full backup of a repository is to use something to
326+
the effect of `cp -a <repo> <destination>`. This is discouraged since
327+
the repository could be written to during the copy operation. In turn
328+
some files at `<destination>` could be corrupted.
329+
330+
This is why it is recommended to use Git tooling for making repository
331+
backups, either with this command or with e.g. linkgit:git-clone[1].
332+
333+
See also linkgit:gitfaq[7], section "TRANSFERS" for a discussion of the
334+
problems associated with file syncing across systems.
335+
324336
FILE FORMAT
325337
-----------
326338

0 commit comments

Comments
 (0)