23
sitting on the other side of the network connection.
24
25
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 (see the "full backup" example in "EXAMPLES"), and to relay
27
+the state of the references in one repository to another (see the second
28
+example).
29
30
Git commands that fetch or otherwise "read" via protocols such as
31
`ssh://` and `https://` can also operate on bundle files. It is
35
corresponding "write" support, i.e.a 'git push' into a bundle is not
36
supported.
37
37
-See the "EXAMPLES" section below for examples of how to use bundles.
38
-
38
BUNDLE FORMAT
39
-------------
40
215
EXAMPLES
216
--------
217
219
-Assume you want to transfer the history from a repository R1 on machine A
220
-to another repository R2 on machine B.
218
+We'll discuss two cases:
219
+
220
+1. Taking a full backup of a repository
221
+2. Transferring the history of a repository to another machine when the
222
+ two machines have no direct connection
223
+
224
+First let's consider a full backup of the repository. The following
225
+command will take a full backup of the repository in the sense that all
226
+refs are included in the bundle:
227
+
228
+----------------
229
+$ git bundle create backup.bundle --all
230
+----------------
231
+
232
+But note again that this is only for the refs, i.e. you will only
233
+include refs and commits reachable from those refs. You will not
234
+include other local state, such as the contents of the index, working
235
+tree, the stash, per-repository configuration, hooks, etc.
236
+
237
+You can later recover that repository by using for example
238
+linkgit:git-clone[1]:
239
+
240
+----------------
241
+$ git clone backup.bundle <new directory>
242
+----------------
243
+
244
+For the next example, assume you want to transfer the history from a
245
+repository R1 on machine A to another repository R2 on machine B.
246
For whatever reason, direct connection between A and B is not allowed,
247
but we can move data from A to B via some mechanism (CD, email, etc.).
248
We want to update R2 with development made on the branch master in R1.