Skip to content

Commit 99d8ea2

Browse files
sbejargitster
authored andcommitted
git-bundle.txt: Add different strategies to create the bundle
Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8e0fbe6 commit 99d8ea2

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

Documentation/git-bundle.txt

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,36 +99,62 @@ Assume two repositories exist as R1 on machine A, and R2 on machine B.
9999
For whatever reason, direct connection between A and B is not allowed,
100100
but we can move data from A to B via some mechanism (CD, email, etc).
101101
We want to update R2 with developments made on branch master in R1.
102+
103+
To create the bundle you have to specify the basis. You have some options:
104+
105+
- Without basis.
106+
+
107+
This is useful when sending the whole history.
108+
109+
------------
110+
$ git bundle create mybundle master
111+
------------
112+
113+
- Using temporally tags.
114+
+
102115
We set a tag in R1 (lastR2bundle) after the previous such transport,
103116
and move it afterwards to help build the bundle.
104117

105-
in R1 on A:
106-
107118
------------
108119
$ git-bundle create mybundle master ^lastR2bundle
109120
$ git tag -f lastR2bundle master
110121
------------
111122

112-
(move mybundle from A to B by some mechanism)
123+
- Using a tag present in both repositories
124+
125+
------------
126+
$ git bundle create mybundle master ^v1.0.0
127+
------------
128+
129+
- A basis based on time.
130+
131+
------------
132+
$ git bundle create mybundle master --since=10.days.ago
133+
------------
113134

114-
in R2 on B:
135+
- With a limit on the number of commits
115136

116137
------------
117-
$ git-bundle verify mybundle
118-
$ git-fetch mybundle refspec
138+
$ git bundle create mybundle master -n 10
119139
------------
120140

121-
where refspec is refInBundle:localRef
141+
Then you move mybundle from A to B, and in R2 on B:
122142

143+
------------
144+
$ git-bundle verify mybundle
145+
$ git-fetch mybundle master:localRef
146+
------------
123147

124-
Also, with something like this in your config:
148+
With something like this in the config in R2:
125149

150+
------------------------
126151
[remote "bundle"]
127152
url = /home/me/tmp/file.bdl
128153
fetch = refs/heads/*:refs/remotes/origin/*
154+
------------------------
129155

130156
You can first sneakernet the bundle file to ~/tmp/file.bdl and
131-
then these commands:
157+
then these commands on machine B:
132158

133159
------------
134160
$ git ls-remote bundle

0 commit comments

Comments
 (0)