@@ -61,25 +61,25 @@ $ git prune
6161$ git count-objects <2>
6262$ git repack <3>
6363$ git prune <4>
64-
64+ ------------
65+ +
6566<1> running without "--full" is usually cheap and assures the
6667repository health reasonably well.
6768<2> check how many loose objects there are and how much
6869diskspace is wasted by not repacking.
6970<3> without "-a" repacks incrementally. repacking every 4-5MB
7071of loose objects accumulation may be a good rule of thumb.
7172<4> after repack, prune removes the duplicate loose objects.
72- ------------
7373
7474Repack a small project into single pack.::
7575+
7676------------
7777$ git repack -a -d <1>
7878$ git prune
79-
79+ ------------
80+ +
8081<1> pack all the objects reachable from the refs into one pack
8182and remove unneeded other packs
82- ------------
8383
8484
8585Individual Developer (Standalone)[[Individual Developer (Standalone)]]
@@ -129,10 +129,10 @@ $ git-init-db
129129$ git add . <1>
130130$ git commit -m 'import of frotz source tree.'
131131$ git tag v2.43 <2>
132-
132+ ------------
133+ +
133134<1> add everything under the current directory.
134135<2> make a lightweight, unannotated tag.
135- ------------
136136
137137Create a topic branch and develop.::
138138+
@@ -153,7 +153,8 @@ $ git checkout master <9>
153153$ git pull . alsa-audio <10>
154154$ git log --since='3 days ago' <11>
155155$ git log v2.43.. curses/ <12>
156-
156+ ------------
157+ +
157158<1> create a new topic branch.
158159<2> revert your botched changes in "curses/ux_audio_oss.c".
159160<3> you need to tell git if you added a new file; removal and
@@ -170,7 +171,6 @@ you originally wrote.
170171combined and include --max-count=10 (show 10 commits), --until='2005-12-10'.
171172<12> view only the changes that touch what's in curses/
172173directory, since v2.43 tag.
173- ------------
174174
175175
176176Individual Developer (Participant)[[Individual Developer (Participant)]]
@@ -208,7 +208,8 @@ $ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <5>
208208$ git reset --hard ORIG_HEAD <6>
209209$ git prune <7>
210210$ git fetch --tags <8>
211-
211+ ------------
212+ +
212213<1> repeat as needed.
213214<2> extract patches from your branch for e-mail submission.
214215<3> "pull" fetches from "origin" by default and merges into the
@@ -221,7 +222,6 @@ area we are interested in.
221222<7> garbage collect leftover objects from reverted pull.
222223<8> from time to time, obtain official tags from the "origin"
223224and store them under .git/refs/tags/.
224- ------------
225225
226226
227227Push into another repository.::
@@ -239,7 +239,8 @@ satellite$ git push origin <4>
239239mothership$ cd frotz
240240mothership$ git checkout master
241241mothership$ git pull . satellite <5>
242-
242+ ------------
243+ +
243244<1> mothership machine has a frotz repository under your home
244245directory; clone from it to start a repository on the satellite
245246machine.
@@ -252,7 +253,6 @@ to local "origin" branch.
252253mothership machine. You could use this as a back-up method.
253254<5> on mothership machine, merge the work done on the satellite
254255machine into the master branch.
255- ------------
256256
257257Branch off of a specific tag.::
258258+
@@ -262,12 +262,12 @@ $ edit/compile/test; git commit -a
262262$ git checkout master
263263$ git format-patch -k -m --stdout v2.6.14..private2.6.14 |
264264 git am -3 -k <2>
265-
265+ ------------
266+ +
266267<1> create a private branch based on a well known (but somewhat behind)
267268tag.
268269<2> forward port all changes in private2.6.14 branch to master branch
269270without a formal "merging".
270- ------------
271271
272272
273273Integrator[[Integrator]]
@@ -317,7 +317,8 @@ $ git tag -s -m 'GIT 0.99.9x' v0.99.9x <10>
317317$ git fetch ko && git show-branch master maint 'tags/ko-*' <11>
318318$ git push ko <12>
319319$ git push ko v0.99.9x <13>
320-
320+ ------------
321+ +
321322<1> see what I was in the middle of doing, if any.
322323<2> see what topic branches I have and think about how ready
323324they are.
@@ -346,7 +347,6 @@ In the output from "git show-branch", "master" should have
346347everything "ko-master" has.
347348<12> push out the bleeding edge.
348349<13> push the tag out, too.
349- ------------
350350
351351
352352Repository Administration[[Repository Administration]]
@@ -367,7 +367,6 @@ example of managing a shared central repository.
367367
368368Examples
369369~~~~~~~~
370-
371370Run git-daemon to serve /pub/scm from inetd.::
372371+
373372------------
@@ -388,13 +387,13 @@ cindy:x:1002:1002::/home/cindy:/usr/bin/git-shell
388387david:x:1003:1003::/home/david:/usr/bin/git-shell
389388$ grep git /etc/shells <2>
390389/usr/bin/git-shell
391-
390+ ------------
391+ +
392392<1> log-in shell is set to /usr/bin/git-shell, which does not
393393allow anything but "git push" and "git pull". The users should
394394get an ssh access to the machine.
395395<2> in many distributions /etc/shells needs to list what is used
396396as the login shell.
397- ------------
398397
399398CVS-style shared repository.::
400399+
@@ -419,23 +418,23 @@ $ cat info/allowed-users <4>
419418refs/heads/master alice\|cindy
420419refs/heads/doc-update bob
421420refs/tags/v[0-9]* david
422-
421+ ------------
422+ +
423423<1> place the developers into the same git group.
424424<2> and make the shared repository writable by the group.
425425<3> use update-hook example by Carl from Documentation/howto/
426426for branch policy control.
427427<4> alice and cindy can push into master, only bob can push into doc-update.
428428david is the release manager and is the only person who can
429429create and push version tags.
430- ------------
431430
432431HTTP server to support dumb protocol transfer.::
433432+
434433------------
435434dev$ git update-server-info <1>
436435dev$ ftp user@isp.example.com <2>
437436ftp> cp -r .git /home/user/myproject.git
438-
437+ ------------
438+ +
439439<1> make sure your info/refs and objects/info/packs are up-to-date
440440<2> upload to public HTTP server hosted by your ISP.
441- ------------
0 commit comments