Oh, I hate to do this but I ended up merging big usage string
cleanups from Fredrik, git-am enhancements that made a lot of
sense for non mbox users from HPA, and rebase changes (done
independently by me and Lukas) among other things, so git is
still in perpetual state of 1.0rc. 1.0 will probably be next
Wednesday, but who knows.
Signed-off-by: Junio C Hamano <junkio@cox.net>
@ -50,6 +50,38 @@ Everybody uses these commands to feed and care git repositories.
@@ -50,6 +50,38 @@ Everybody uses these commands to feed and care git repositories.
* gitlink:git-repack[1] to pack loose objects for efficiency.
Examples
~~~~~~~~
Check health and remove cruft.::
+
------------
$ git fsck-objects <1>
$ git prune
$ git count-objects <2>
$ git repack <3>
$ git prune <4>
<1> running without "--full" is usually cheap and assures the
repository health reasonably well.
<2> check how many loose objects there are and how much
diskspace is wasted by not repacking.
<3> without "-a" repacks incrementally. repacking every 4-5MB
of loose objects accumulation may be a good rule of thumb.
<4> after repack, prune removes the duplicate loose objects.
------------
Repack a small project into single pack.::
+
------------
$ git repack -a -d <1>
$ git prune
<1> pack all the objects reachable from the refs into one pack
@ -90,15 +180,93 @@ A developer working as a participant in a group project needs to
@@ -90,15 +180,93 @@ A developer working as a participant in a group project needs to
learn how to communicate with others, and uses these commands in
addition to the ones needed by a standalone developer.
* gitlink:git-pull[1] from "origin" to keep up-to-date with
the upstream.
* gitlink:git-clone[1] from the upstream to prime your local
repository.
* gitlink:git-pull[1] and gitlink:git-fetch[1] from "origin"
to keep up-to-date with the upstream.
* gitlink:git-push[1] to shared repository if you adopt CVS
* gitlink:git-push[1] to shared repository, if you adopt CVS
style shared repository workflow.
* gitlink:git-format-patch[1] to prepare e-mail submission, if
you adopt Linux kernel-style public forum workflow.
Examples
~~~~~~~~
Clone the upstream and work on it. Feed changes to upstream.::
<1> create a private branch based on a well known (but somewhat behind)
tag.
<2> forward port all changes in private2.6.14 branch to master branch
without a formal "merging".
------------
Integrator[[Integrator]]
------------------------
@ -121,6 +289,62 @@ commands in addition to the ones needed by participants.
@@ -121,6 +289,62 @@ commands in addition to the ones needed by participants.
* gitlink:git-push[1] to publish the bleeding edge.
@ -50,10 +50,14 @@ the `Makefile` to two revisions back, deletes hello.c by
@@ -50,10 +50,14 @@ the `Makefile` to two revisions back, deletes hello.c by
mistake, and gets it back from the index.
------------
$ git checkout master
$ git checkout master~2 Makefile
$ git checkout master <1>
$ git checkout master~2 Makefile <2>
$ rm -f hello.c
$ git checkout hello.c
$ git checkout hello.c <3>
<1> switch branch
<2> take out a file out of other commit
<3> or "git checkout -- hello.c", as in the next example.
------------
If you have an unfortunate branch that is named `hello.c`, the
@ -31,7 +31,7 @@ test tree and then pull to the release tree as that would leave trivial
@@ -31,7 +31,7 @@ test tree and then pull to the release tree as that would leave trivial
patches blocked in the test tree waiting for complex changes to accumulate
enough test time to graduate.
Back in the BitKeeper days I achieved this my creating small forests of
Back in the BitKeeper days I achieved this by creating small forests of
temporary trees, one tree for each logical grouping of patches, and then
pulling changes from these trees first to the test tree, and then to the
release tree. At first I replicated this in GIT, but then I realised
@ -42,7 +42,8 @@ So here is the step-by-step guide how this all works for me.
@@ -42,7 +42,8 @@ So here is the step-by-step guide how this all works for me.
First create your work tree by cloning Linus's public tree:
$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git work
$ git clone \
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git work
Change directory into the cloned tree you just created
@ -52,7 +53,7 @@ Set up a remotes file so that you can fetch the latest from Linus' master
@@ -52,7 +53,7 @@ Set up a remotes file so that you can fetch the latest from Linus' master
@ -16,8 +13,8 @@ Each commit between the fork-point and <head> is examined, and
@@ -16,8 +13,8 @@ Each commit between the fork-point and <head> is examined, and
compared against the change each commit between the fork-point and
<upstream> introduces. If the change seems to be in the upstream,
it is shown on the standard output with prefix "+". Otherwise
it is shown with prefix "-".
'
it is shown with prefix "-".'
. git-sh-setup
case "$1" in -v) verbose=t; shift ;; esac
@ -35,7 +32,7 @@ case "$#" in
@@ -35,7 +32,7 @@ case "$#" in
LONG_USAGE='Prepare each commit with its patch since our-head forked from upstream,
one file per patch, for e-mail submission. Each output file is
numbered sequentially from 1, and uses the first line of the commit
message (massaged for pathname safety) as the filename.
@ -28,10 +17,12 @@ as "[PATCH N/M] Subject", unless you have only one patch.
@@ -28,10 +17,12 @@ as "[PATCH N/M] Subject", unless you have only one patch.
When --mbox is specified, the output is formatted to resemble
UNIX mailbox format, and can be concatenated together for processing
@ -179,6 +179,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -179,6 +179,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@ -232,6 +233,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -232,6 +233,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
error("remote '%s' object %s does not "
"exist on local",
ref->name, sha1_to_hex(ref->old_sha1));
ret = -2;
continue;
}
@ -245,12 +247,14 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -245,12 +247,14 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@ -267,7 +271,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -267,7 +271,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)