]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Documentation/git-bundle.txt: discuss naïve backups
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Sat, 16 Nov 2024 14:54:54 +0000 (15:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2024 00:56:26 +0000 (09:56 +0900)
It might be naïve to think that those who need this education would end
up here in the first place.  But I think it’s good to mention this
high-level concept here on a command which provides a backup strategy.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-bundle.txt

index eaa16fc4b83e116b8ff223cb7e724127eb4272bb..504b8a8143ae6809046fdd5e84eef59e39ed6809 100644 (file)
@@ -344,6 +344,24 @@ 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 -r <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].
+But keep in mind that these tools will not help you backup state other
+than refs and commits.  In other words they will not help you backup
+contents of the index, working tree, the stash, per-repository
+configuration, hooks, etc.
+
+See also linkgit:gitfaq[7], section "TRANSFERS" for a discussion of the
+problems associated with file syncing across systems.
+
 FILE FORMAT
 -----------