@@ -61,25 +61,25 @@ $ git prune
61
61
$ git count-objects <2>
62
62
$ git repack <3>
63
63
$ git prune <4>
64
-
64
+ ------------
65
+ +
65
66
<1> running without "--full" is usually cheap and assures the
66
67
repository health reasonably well.
67
68
<2> check how many loose objects there are and how much
68
69
diskspace is wasted by not repacking.
69
70
<3> without "-a" repacks incrementally. repacking every 4-5MB
70
71
of loose objects accumulation may be a good rule of thumb.
71
72
<4> after repack, prune removes the duplicate loose objects.
72
- ------------
73
73
74
74
Repack a small project into single pack.::
75
75
+
76
76
------------
77
77
$ git repack -a -d <1>
78
78
$ git prune
79
-
79
+ ------------
80
+ +
80
81
<1> pack all the objects reachable from the refs into one pack
81
82
and remove unneeded other packs
82
- ------------
83
83
84
84
85
85
Individual Developer (Standalone)[[Individual Developer (Standalone)]]
@@ -129,10 +129,10 @@ $ git-init-db
129
129
$ git add . <1>
130
130
$ git commit -m 'import of frotz source tree.'
131
131
$ git tag v2.43 <2>
132
-
132
+ ------------
133
+ +
133
134
<1> add everything under the current directory.
134
135
<2> make a lightweight, unannotated tag.
135
- ------------
136
136
137
137
Create a topic branch and develop.::
138
138
+
@@ -153,7 +153,8 @@ $ git checkout master <9>
153
153
$ git pull . alsa-audio <10>
154
154
$ git log --since='3 days ago' <11>
155
155
$ git log v2.43.. curses/ <12>
156
-
156
+ ------------
157
+ +
157
158
<1> create a new topic branch.
158
159
<2> revert your botched changes in "curses/ux_audio_oss.c".
159
160
<3> you need to tell git if you added a new file; removal and
@@ -170,7 +171,6 @@ you originally wrote.
170
171
combined and include --max-count=10 (show 10 commits), --until='2005-12-10'.
171
172
<12> view only the changes that touch what's in curses/
172
173
directory, since v2.43 tag.
173
- ------------
174
174
175
175
176
176
Individual Developer (Participant)[[Individual Developer (Participant)]]
@@ -208,7 +208,8 @@ $ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <5>
208
208
$ git reset --hard ORIG_HEAD <6>
209
209
$ git prune <7>
210
210
$ git fetch --tags <8>
211
-
211
+ ------------
212
+ +
212
213
<1> repeat as needed.
213
214
<2> extract patches from your branch for e-mail submission.
214
215
<3> "pull" fetches from "origin" by default and merges into the
@@ -221,7 +222,6 @@ area we are interested in.
221
222
<7> garbage collect leftover objects from reverted pull.
222
223
<8> from time to time, obtain official tags from the "origin"
223
224
and store them under .git/refs/tags/.
224
- ------------
225
225
226
226
227
227
Push into another repository.::
@@ -239,7 +239,8 @@ satellite$ git push origin <4>
239
239
mothership$ cd frotz
240
240
mothership$ git checkout master
241
241
mothership$ git pull . satellite <5>
242
-
242
+ ------------
243
+ +
243
244
<1> mothership machine has a frotz repository under your home
244
245
directory; clone from it to start a repository on the satellite
245
246
machine.
@@ -252,7 +253,6 @@ to local "origin" branch.
252
253
mothership machine. You could use this as a back-up method.
253
254
<5> on mothership machine, merge the work done on the satellite
254
255
machine into the master branch.
255
- ------------
256
256
257
257
Branch off of a specific tag.::
258
258
+
@@ -262,12 +262,12 @@ $ edit/compile/test; git commit -a
262
262
$ git checkout master
263
263
$ git format-patch -k -m --stdout v2.6.14..private2.6.14 |
264
264
git am -3 -k <2>
265
-
265
+ ------------
266
+ +
266
267
<1> create a private branch based on a well known (but somewhat behind)
267
268
tag.
268
269
<2> forward port all changes in private2.6.14 branch to master branch
269
270
without a formal "merging".
270
- ------------
271
271
272
272
273
273
Integrator[[Integrator]]
@@ -317,7 +317,8 @@ $ git tag -s -m 'GIT 0.99.9x' v0.99.9x <10>
317
317
$ git fetch ko && git show-branch master maint 'tags/ko-*' <11>
318
318
$ git push ko <12>
319
319
$ git push ko v0.99.9x <13>
320
-
320
+ ------------
321
+ +
321
322
<1> see what I was in the middle of doing, if any.
322
323
<2> see what topic branches I have and think about how ready
323
324
they are.
@@ -346,7 +347,6 @@ In the output from "git show-branch", "master" should have
346
347
everything "ko-master" has.
347
348
<12> push out the bleeding edge.
348
349
<13> push the tag out, too.
349
- ------------
350
350
351
351
352
352
Repository Administration[[Repository Administration]]
@@ -367,7 +367,6 @@ example of managing a shared central repository.
367
367
368
368
Examples
369
369
~~~~~~~~
370
-
371
370
Run git-daemon to serve /pub/scm from inetd.::
372
371
+
373
372
------------
@@ -388,13 +387,13 @@ cindy:x:1002:1002::/home/cindy:/usr/bin/git-shell
388
387
david:x:1003:1003::/home/david:/usr/bin/git-shell
389
388
$ grep git /etc/shells <2>
390
389
/usr/bin/git-shell
391
-
390
+ ------------
391
+ +
392
392
<1> log-in shell is set to /usr/bin/git-shell, which does not
393
393
allow anything but "git push" and "git pull". The users should
394
394
get an ssh access to the machine.
395
395
<2> in many distributions /etc/shells needs to list what is used
396
396
as the login shell.
397
- ------------
398
397
399
398
CVS-style shared repository.::
400
399
+
@@ -419,23 +418,23 @@ $ cat info/allowed-users <4>
419
418
refs/heads/master alice\|cindy
420
419
refs/heads/doc-update bob
421
420
refs/tags/v[0-9]* david
422
-
421
+ ------------
422
+ +
423
423
<1> place the developers into the same git group.
424
424
<2> and make the shared repository writable by the group.
425
425
<3> use update-hook example by Carl from Documentation/howto/
426
426
for branch policy control.
427
427
<4> alice and cindy can push into master, only bob can push into doc-update.
428
428
david is the release manager and is the only person who can
429
429
create and push version tags.
430
- ------------
431
430
432
431
HTTP server to support dumb protocol transfer.::
433
432
+
434
433
------------
435
434
dev$ git update-server-info <1>
436
435
437
436
ftp> cp -r .git /home/user/myproject.git
438
-
437
+ ------------
438
+ +
439
439
<1> make sure your info/refs and objects/info/packs are up-to-date
440
440
<2> upload to public HTTP server hosted by your ISP.
441
- ------------
0 commit comments