.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-ADD" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-ADD" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
The command loop shows the list of subcommands available, and gives a prompt "What now> ". In general, when the prompt ends with a single \fI>\fR, you can pick only one of the choices given and type return, like this:
.sp
.nf
+.ft C
*** Commands ***
1: status 2: update 3: revert 4: add untracked
5: patch 6: diff 7: quit 8: help
What now> 1
+.ft
+
.fi
You also could say "s" or "sta" or "status" above as long as the choice is unique.
This shows the change between HEAD and index (i.e. what will be committed if you say "git commit"), and between index and working tree files (i.e. what you could stage further before "git commit" using "git\-add") for each path. A sample output looks like this:
.sp
.nf
+.ft C
staged unstaged path
1: binary nothing foo.png
2: +403/\-35 +1/\-1 git\-add\-\-interactive.perl
+.ft
+
.fi
It shows that foo.png has differences from HEAD (but that is binary so line count cannot be shown) and there is no difference between indexed copy and the working tree version (if the working tree version were also different, \fIbinary\fR would have been shown in place of \fInothing\fR). The other file, git\-add\-\-interactive.perl, has 403 lines added and 35 lines deleted if you commit what is in the index, but working tree file has further modifications (one addition and one deletion).
.TP
What you chose are then highlighted with \fI*\fR, like this:
.sp
.nf
+.ft C
staged unstaged path
1: binary nothing foo.png
* 2: +403/\-35 +1/\-1 git\-add\-\-interactive.perl
+.ft
+
.fi
To remove selection, prefix the input with \- like this:
.sp
.nf
+.ft C
Update>> \-2
+.ft
+
.fi
After making the selection, answer with an empty line to stage the contents of working tree files for selected paths in the index.
.TP
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-AM" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-AM" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-ANNOTATE" "1" "06/16/2007" "Git 1.5.2.rc0.71.g4342" "Git Manual"
+.TH "GIT\-ANNOTATE" "1" "07/19/2007" "Git 1.5.2.rc0.71.g4342" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-APPLY" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-APPLY" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-ARCHIMPORT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-ARCHIMPORT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-ARCHIVE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-ARCHIVE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-BISECT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-BISECT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
The way you use it is:
.sp
.nf
+.ft C
$ git bisect start
$ git bisect bad # Current version is bad
$ git bisect good v2.6.13\-rc2 # v2.6.13\-rc2 was the last version
# tested that was good
+.ft
+
.fi
When you give at least one bad and one good versions, it will bisect the revision tree and say something like:
.sp
.nf
+.ft C
Bisecting: 675 revisions left to test after this
+.ft
+
.fi
and check out the state in the middle. Now, compile that kernel, and boot it. Now, let's say that this booted kernel works fine, then just do
.sp
.nf
+.ft C
$ git bisect good # this one is good
+.ft
+
.fi
which will now say
.sp
.nf
+.ft C
Bisecting: 337 revisions left to test after this
+.ft
+
.fi
and you continue along, compiling that one, testing it, and depending on whether it is good or bad, you say "git bisect good" or "git bisect bad", and ask for the next bisection.
Oh, and then after you want to reset to the original head, do a
.sp
.nf
+.ft C
$ git bisect reset
+.ft
+
.fi
to get back to the master branch, instead of being in one of the bisection branches ("git bisect start" will do that for you too, actually: it will reset the bisection state, and before it does that it checks that you're not using some old bisection branch).
.SS "Bisect visualize"
During the bisection process, you can say
.sp
.nf
+.ft C
$ git bisect visualize
+.ft
+
.fi
to see the currently remaining suspects in gitk.
.SS "Bisect log and bisect replay"
The good/bad input is logged, and
.sp
.nf
+.ft C
$ git bisect log
+.ft
+
.fi
shows what you have done so far. You can truncate its output somewhere and save it in a file, and run
.sp
.nf
+.ft C
$ git bisect replay that\-file
+.ft
+
.fi
if you find later you made a mistake telling good/bad about a revision.
.SS "Avoiding to test a commit"
It goes something like this:
.sp
.nf
+.ft C
$ git bisect good/bad # previous round was good/bad.
Bisecting: 337 revisions left to test after this
$ git bisect visualize # oops, that is uninteresting.
$ git reset \-\-hard HEAD~3 # try 3 revs before what
# was suggested
+.ft
+
.fi
Then compile and test the one you chose to try. After that, tell bisect what the result was as usual.
.SS "Cutting down bisection by giving more parameters to bisect start"
You can further cut down the number of trials if you know what part of the tree is involved in the problem you are tracking down, by giving paths parameters when you say bisect start, like this:
.sp
.nf
+.ft C
$ git bisect start \-\- arch/i386 include/asm\-i386
+.ft
+
.fi
If you know beforehand more than one good commits, you can narrow the bisect space down without doing the whole tree checkout every time you give good commits. You give the bad revision immediately after start and then you give all the good revisions you have:
.sp
.nf
+.ft C
$ git bisect start v2.6.20\-rc6 v2.6.20\-rc4 v2.6.20\-rc1 \-\-
# v2.6.20\-rc6 is bad
# v2.6.20\-rc4 and v2.6.20\-rc1 are good
+.ft
+
.fi
.SS "Bisect run"
If you have a script that can tell if the current source code is good or bad, you can automatically bisect using:
.sp
.nf
+.ft C
$ git bisect run my_script
+.ft
+
.fi
Note that the "run" script (my_script in the above example) should exit with code 0 in case the current source code is good and with a code between 1 and 127 (included) in case the current source code is bad.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-BLAME" "1" "06/16/2007" "Git 1.5.2.1.271.g90ac" "Git Manual"
+.TH "GIT\-BLAME" "1" "07/19/2007" "Git 1.5.2.1.271.g90ac" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-BRANCH" "1" "07/17/2007" "Git 1.5.3.rc2.4.g726f9" "Git Manual"
+.TH "GIT\-BRANCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Start development off of a known tag
.sp
.nf
+.ft C
$ git clone git://git.kernel.org/pub/scm/.../linux\-2.6 my2.6
$ cd my2.6
$ git branch my2.6.14 v2.6.14 \fB(1)\fR
$ git checkout my2.6.14
+.ft
+
.fi
.sp
\fB1. \fRThis step and the next one could be combined into a single step with "checkout \-b my2.6.14 v2.6.14".
Delete unneeded branch
.sp
.nf
+.ft C
$ git clone git://git.kernel.org/.../git.git my.git
$ cd my.git
$ git branch \-d \-r origin/todo origin/html origin/man \fB(1)\fR
$ git branch \-D test \fB(2)\fR
+.ft
+
.fi
.sp
\fB1. \fRdelete remote\-tracking branches "todo", "html", "man"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-BUNDLE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-BUNDLE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CAT\-FILE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CAT\-FILE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHECK\-ATTR" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CHECK\-ATTR" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHECK\-REF\-FORMAT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CHECK\-REF\-FORMAT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHECKOUT\-INDEX" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CHECKOUT\-INDEX" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Intuitiveness is not the goal here. Repeatability is. The reason for the "no arguments means no work" behavior is that from scripts you are supposed to be able to do:
.sp
.nf
+.ft C
$ find . \-name '*.h' \-print0 | xargs \-0 git\-checkout\-index \-f \-\-
+.ft
+
.fi
which will force all existing *.h files to be replaced with their cached copies. If an empty command line implied "all", then this would force\-refresh everything in the index, which was not the point. But since git\-checkout\-index accepts \-\-stdin it would be faster to use:
.sp
.nf
+.ft C
$ find . \-name '*.h' \-print0 | git\-checkout\-index \-f \-z \-\-stdin
+.ft
+
.fi
The \-\- is just a good idea when you know the rest will be filenames; it will prevent problems with a filename of, for example, \-a. Using \-\- is probably a good policy in scripts.
.SH "USING \-\-TEMP OR \-\-STAGE=ALL"
To update and refresh only the files already checked out
.sp
.nf
+.ft C
$ git\-checkout\-index \-n \-f \-a && git\-update\-index \-\-ignore\-missing \-\-refresh
+.ft
+
.fi
.TP
Using git\-checkout\-index to "export an entire tree"
The prefix ability basically makes it trivial to use git\-checkout\-index as an "export as tree" function. Just read the desired tree into the index, and do:
.sp
.nf
+.ft C
$ git\-checkout\-index \-\-prefix=git\-export\-dir/ \-a
+.ft
+
.fi
git\-checkout\-index will "export" the index into the specified directory.
Export files with a prefix
.sp
.nf
+.ft C
$ git\-checkout\-index \-\-prefix=.merged\- Makefile
+.ft
+
.fi
This will check out the currently cached copy of Makefile into the file .merged\-Makefile.
.SH "AUTHOR"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHECKOUT" "1" "07/12/2007" "Git 1.5.3.rc0.101.gd972c" "Git Manual"
+.TH "GIT\-CHECKOUT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
It is sometimes useful to be able to \fIcheckout\fR a commit that is not at the tip of one of your branches. The most obvious example is to check out the commit at a tagged official release point, like this:
.sp
.nf
+.ft C
$ git checkout v2.6.18
+.ft
+
.fi
Earlier versions of git did not allow this and asked you to create a temporary branch using \-b option, but starting from version 1.5.0, the above command \fIdetaches\fR your HEAD from the current branch and directly point at the commit named by the tag (v2.6.18 in the above example).
The state you are in while your HEAD is detached is not recorded by any branch (which is natural \-\-\- you are not on any branch). What this means is that you can discard your temporary commits and merges by switching back to an existing branch (e.g. git checkout master), and a later git prune or git gc would garbage\-collect them. If you did this by mistake, you can ask the reflog for HEAD where you were, e.g.
.sp
.nf
+.ft C
$ git log \-g \-2 HEAD
+.ft
+
.fi
.SH "EXAMPLES"
.TP 3
The following sequence checks out the master branch, reverts the Makefile to two revisions back, deletes hello.c by mistake, and gets it back from the index.
.sp
.nf
+.ft C
$ git checkout master \fB(1)\fR
$ git checkout master~2 Makefile \fB(2)\fR
$ rm \-f hello.c
$ git checkout hello.c \fB(3)\fR
+.ft
+
.fi
.sp
\fB1. \fRswitch branch
If you have an unfortunate branch that is named hello.c, this step would be confused as an instruction to switch to that branch. You should instead write:
.sp
.nf
+.ft C
$ git checkout \-\- hello.c
+.ft
+
.fi
.br
.TP
After working in a wrong branch, switching to the correct branch would be done using:
.sp
.nf
+.ft C
$ git checkout mytopic
+.ft
+
.fi
However, your "wrong" branch and correct "mytopic" branch may differ in files that you have locally modified, in which case, the above checkout would fail like this:
.sp
.nf
+.ft C
$ git checkout mytopic
fatal: Entry 'frotz' not uptodate. Cannot merge.
+.ft
+
.fi
You can give the \-m flag to the command, which would try a three\-way merge:
.sp
.nf
+.ft C
$ git checkout \-m mytopic
Auto\-merging frotz
+.ft
+
.fi
After this three\-way merge, the local modifications are _not_ registered in your index file, so git diff would show you what changes you made since the tip of the new branch.
.TP
When a merge conflict happens during switching branches with the \-m option, you would see something like this:
.sp
.nf
+.ft C
$ git checkout \-m mytopic
Auto\-merging frotz
merge: warning: conflicts during merge
ERROR: Merge conflict in frotz
fatal: merge program failed
+.ft
+
.fi
At this point, git diff shows the changes cleanly merged as in the previous example, as well as the changes in the conflicted files. Edit and resolve the conflict and mark it resolved with git add as usual:
.sp
.nf
+.ft C
$ edit frotz
$ git add frotz
+.ft
+
.fi
.SH "AUTHOR"
Written by Linus Torvalds <torvalds@osdl.org>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHERRY\-PICK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CHERRY\-PICK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CHERRY" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CHERRY" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CITOOL" "1" "06/23/2007" "Git 1.5.2.2.277.g4d9b" "Git Manual"
+.TH "GIT\-CITOOL" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CLEAN" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CLEAN" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CLONE" "1" "07/13/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
+.TH "GIT\-CLONE" "1" "07/19/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-COMMIT\-TREE" "1" "07/15/2007" "Git 1.5.3.rc1.27.ga5e40" "Git Manual"
+.TH "GIT\-COMMIT\-TREE" "1" "07/19/2007" "Git 1.5.3.rc1.27.ga5e40" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-COMMIT" "1" "07/13/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
+.TH "GIT\-COMMIT" "1" "07/19/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CONFIG" "1" "07/13/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
+.TH "GIT\-CONFIG" "1" "07/19/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CONVERT\-OBJECTS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CONVERT\-OBJECTS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-COUNT\-OBJECTS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-COUNT\-OBJECTS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CVSEXPORTCOMMIT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CVSEXPORTCOMMIT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Merge one patch into CVS
.sp
.nf
+.ft C
$ export GIT_DIR=~/project/.git
$ cd ~/project_cvs_checkout
$ git\-cvsexportcommit \-v <commit\-sha1>
$ cvs commit \-F .mgs <files>
+.ft
+
.fi
.TP
Merge pending patches into CVS automatically \(em only if you really know what you are doing
.sp
.nf
+.ft C
$ export GIT_DIR=~/project/.git
$ cd ~/project_cvs_checkout
$ git\-cherry cvshead myhead | sed \-n 's/^+ //p' | xargs \-l1 git\-cvsexportcommit \-c \-p \-v
+.ft
+
.fi
.SH "AUTHOR"
Written by Martin Langhoff <martin@catalyst.net.nz>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CVSIMPORT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CVSIMPORT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
CVS by default uses the Unix username when writing its commit logs. Using this option and an author\-conv\-file in this format
.sp
.nf
+.ft C
exon=Andreas Ericsson <ae@op5.se>
spawn=Simon Pawn <spawn@frog\-pond.org>
+.ft
+
.fi
git\-cvsimport will make it appear as those authors had their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly all along.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-CVSSERVER" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-CVSSERVER" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
If you are going to offer anonymous CVS access via pserver, add a line in /etc/inetd.conf like
.sp
.nf
+.ft C
cvspserver stream tcp nowait nobody git\-cvsserver pserver
+.ft
+
.fi
Note: Some inetd servers let you specify the name of the executable independently of the value of argv[0] (i.e. the name the program assumes it was executed with). In this case the correct line in /etc/inetd.conf looks like
.sp
.nf
+.ft C
cvspserver stream tcp nowait nobody /usr/bin/git\-cvsserver git\-cvsserver pserver
+.ft
+
.fi
No special setup is needed for SSH access, other than having GIT tools in the PATH. If you have clients that do not accept the CVS_SERVER environment variable, you can rename git\-cvsserver to cvs.
Note: Newer cvs versions (>= 1.12.11) also support specifying CVS_SERVER directly in CVSROOT like
.sp
.nf
+.ft C
cvs \-d ":ext;CVS_SERVER=git\-cvsserver:user@server/path/repo.git" co <HEAD_name>
+.ft
+
.fi
This has the advantage that it will be saved in your \fICVS/Root\fR files and you don't need to worry about always setting the correct environment variable.
.TP
For each repo that you want accessible from CVS you need to edit config in the repo and add the following section.
.sp
.nf
+.ft C
[gitcvs]
enabled=1
# optional for debugging
logfile=/path/to/logfile
+.ft
+
.fi
Note: you need to ensure each user that is going to invoke git\-cvsserver has write access to the log file and to the database (see Database Backend. If you want to offer write access over SSH, the users of course also need write access to the git repository itself.
All configuration variables can also be overridden for a specific method of access. Valid method names are "ext" (for SSH access) and "pserver". The following example configuration would disable pserver access while still allowing access over SSH.
.sp
.nf
+.ft C
[gitcvs]
enabled=0
[gitcvs "ext"]
enabled=1
+.ft
+
.fi
.TP
3.
Example:
.sp
.nf
+.ft C
export CVSROOT=:ext:user@server:/var/git/project.git
export CVS_SERVER=git\-cvsserver
+.ft
+
.fi
.TP
4.
Clients should now be able to check out the project. Use the CVS \fImodule\fR name to indicate what GIT \fIhead\fR you want to check out. Example:
.sp
.nf
+.ft C
cvs co \-d project\-master master
+.ft
+
.fi
.SH "DATABASE BACKEND"
git\-cvsserver uses one database per git head (i.e. CVS module) to store information about the repository for faster access. The database doesn't contain any persistent data and can be completely regenerated from the git repository at any time. The database needs to be updated (i.e. written to) after every commit.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DAEMON" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-DAEMON" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
We assume the following in /etc/services
.sp
.nf
+.ft C
$ grep 9418 /etc/services
git 9418/tcp # Git Version Control System
+.ft
+
.fi
.TP
git\-daemon as inetd server
To set up git\-daemon as an inetd service that handles any repository under the whitelisted set of directories, /pub/foo and /pub/bar, place an entry like the following into /etc/inetd all on one line:
.sp
.nf
+.ft C
git stream tcp nowait nobody /usr/bin/git\-daemon
git\-daemon \-\-inetd \-\-verbose \-\-export\-all
/pub/foo /pub/bar
+.ft
+
.fi
.TP
git\-daemon as inetd server for virtual hosts
To set up git\-daemon as an inetd service that handles repositories for different virtual hosts, www.example.com and www.example.org, place an entry like the following into /etc/inetd all on one line:
.sp
.nf
+.ft C
git stream tcp nowait nobody /usr/bin/git\-daemon
git\-daemon \-\-inetd \-\-verbose \-\-export\-all
\-\-interpolated\-path=/pub/%H%D
/pub/www.example.org/software
/pub/www.example.com/software
/software
+.ft
+
.fi
In this example, the root\-level directory /pub will contain a subdirectory for each virtual host name supported. Further, both hosts advertise repositories simply as git://www.example.com/software/repo.git. For pre\-1.4.0 clients, a symlink from /software into the appropriate default repository could be made as well.
.TP
To set up git\-daemon as a regular, non\-inetd service that handles repositories for multiple virtual hosts based on their IP addresses, start the daemon like this:
.sp
.nf
+.ft C
git\-daemon \-\-verbose \-\-export\-all
\-\-interpolated\-path=/pub/%IP/%D
/pub/192.168.1.200/software
/pub/10.10.220.23/software
+.ft
+
.fi
In this example, the root\-level directory /pub will contain a subdirectory for each virtual host IP address supported. Repositories can still be accessed by hostname though, assuming they correspond to these IP addresses.
.SH "AUTHOR"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DESCRIBE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-DESCRIBE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DIFF\-FILES" "1" "07/04/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
+.TH "GIT\-DIFF\-FILES" "1" "07/19/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DIFF\-INDEX" "1" "07/04/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
+.TH "GIT\-DIFF\-INDEX" "1" "07/19/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DIFF\-TREE" "1" "07/14/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
+.TH "GIT\-DIFF\-TREE" "1" "07/19/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-DIFF" "1" "07/04/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
+.TH "GIT\-DIFF" "1" "07/19/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FAST\-IMPORT" "1" "07/15/2007" "Git 1.5.3.rc1.27.ga5e40" "Git Manual"
+.TH "GIT\-FAST\-IMPORT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
The special case of restarting an incremental import from the current branch value should be written as:
.sp
.nf
+.ft C
from refs/heads/branch^0
+.ft
+
.fi
The ^0 suffix is necessary as fast\-import does not permit a branch to start from itself, and the branch is created in memory before the from command is even read from the input. Adding ^0 will force fast\-import to resolve the commit through Git's revision parsing library, rather than its internal branch table, thereby loading in the existing value of the branch.
.RE
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FETCH\-PACK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-FETCH\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FETCH" "1" "07/06/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
+.TH "GIT\-FETCH" "1" "07/19/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FILTER\-BRANCH" "1" "07/06/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
+.TH "GIT\-FILTER\-BRANCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Suppose you want to remove a file (containing confidential information or copyright violation) from all commits:
.sp
.nf
+.ft C
git filter\-branch \-\-tree\-filter 'rm filename' newbranch
+.ft
+
.fi
A significantly faster version:
.sp
.nf
+.ft C
git filter\-branch \-\-index\-filter 'git update\-index \-\-remove filename' newbranch
+.ft
+
.fi
Now, you will get the rewritten history saved in the branch \fInewbranch\fR (your current branch is left untouched).
To set a commit (which typically is at the tip of another history) to be the parent of the current initial commit, in order to paste the other history behind the current history:
.sp
.nf
+.ft C
git filter\-branch \-\-parent\-filter 'sed "s/^\\$/\-p <graft\-id>/"' newbranch
+.ft
+
.fi
(if the parent string is empty \- therefore we are dealing with the initial commit \- add graftcommit as a parent). Note that this assumes history with a single root (that is, no merge without common ancestors happened). If this is not the case, use:
.sp
.nf
+.ft C
git filter\-branch \-\-parent\-filter \\
'cat; test $GIT_COMMIT = <commit\-id> && echo "\-p <graft\-id>"' newbranch
+.ft
+
.fi
or even simpler:
.sp
.nf
+.ft C
echo "$commit\-id $graft\-id" >> .git/info/grafts
git filter\-branch newbranch $graft\-id..
+.ft
+
.fi
To remove commits authored by "Darl McBribe" from the history:
.sp
.nf
+.ft C
git filter\-branch \-\-commit\-filter '
if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ];
then
else
git commit\-tree "$@";
fi' newbranch
+.ft
+
.fi
The shift magic first throws away the tree id and then the \-p parameters. Note that this handles merges properly! In case Darl committed a merge between P1 and P2, it will be propagated properly and all children of the merge will become merge commits with P1,P2 as their parents instead of the merge commit.
Consider this history:
.sp
.nf
+.ft C
D\-\-E\-\-F\-\-G\-\-H
/ /
A\-\-B\-\-\-\-\-C
+.ft
+
.fi
To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use:
.sp
.nf
+.ft C
git filter\-branch ... new\-H C..H
+.ft
+
.fi
To rewrite commits E,F,G,H, use one of these:
.sp
.nf
+.ft C
git filter\-branch ... new\-H C..H \-\-not D
git filter\-branch ... new\-H D..H \-\-not C
+.ft
+
.fi
To move the whole tree into a subdirectory, or remove it from there:
.sp
.nf
+.ft C
git filter\-branch \-\-index\-filter \\
'git ls\-files \-s | sed "s\-\\t\-&newsubdir/\-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \\
git update\-index \-\-index\-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved
+.ft
+
.fi
.SH "AUTHOR"
Written by Petr "Pasky" Baudis <pasky@suse.cz>, and the git list <git@vger.kernel.org>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FMT\-MERGE\-MSG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-FMT\-MERGE\-MSG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FOR\-EACH\-REF" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-FOR\-EACH\-REF" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
An example directly producing formatted text. Show the most recent 3 tagged commits::
.sp
.nf
+.ft C
#!/bin/sh
git\-for\-each\-ref \-\-count=3 \-\-sort='\-*authordate' \\
%(*body)
\' 'refs/tags'
+.ft
+
.fi
A simple example showing the use of shell eval on the output, demonstrating the use of \-\-shell. List the prefixes of all heads::
.sp
.nf
+.ft C
#!/bin/sh
git\-for\-each\-ref \-\-shell \-\-format="ref=%(refname)" refs/heads | \\
eval "$entry"
echo `dirname $ref`
done
+.ft
+
.fi
A bit more elaborate report on tags, demonstrating that the format may be an entire script::
.sp
.nf
+.ft C
#!/bin/sh
fmt='
\-\-sort=\-taggerdate \\
refs/tags`
eval "$eval"
+.ft
+
.fi
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FORMAT\-PATCH" "1" "07/04/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
+.TH "GIT\-FORMAT\-PATCH" "1" "07/19/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FSCK\-OBJECTS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-FSCK\-OBJECTS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-FSCK" "1" "07/04/2007" "Git 1.5.3.rc0.11.ge2b1a" "Git Manual"
+.TH "GIT\-FSCK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-GC" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-GC" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-GET\-TAR\-COMMIT\-I" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-GET\-TAR\-COMMIT\-I" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-GREP" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-GREP" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-GUI" "1" "06/23/2007" "Git 1.5.2.2.277.g4d9b" "Git Manual"
+.TH "GIT\-GUI" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-HASH\-OBJECT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-HASH\-OBJECT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-HTTP\-FETCH" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-HTTP\-FETCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-HTTP\-PUSH" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-HTTP\-PUSH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-IMAP\-SEND" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-IMAP\-SEND" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-INDEX\-PACK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-INDEX\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-INIT\-DB" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-INIT\-DB" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-INIT" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-INIT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Start a new git repository for an existing code base
.sp
.nf
+.ft C
$ cd /path/to/my/codebase
$ git\-init \fB(1)\fR
$ git\-add . \fB(2)\fR
+.ft
+
.fi
.sp
\fB1. \fRprepare /path/to/my/codebase/.git directory
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-INSTAWEB" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-INSTAWEB" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
You may specify configuration in your .git/config
.sp
.nf
+.ft C
[instaweb]
local = true
httpd = apache2 \-f
port = 4321
browser = konqueror
modulepath = /usr/lib/apache2/modules
+.ft
+
.fi
.SH "AUTHOR"
Written by Eric Wong <normalperson@yhbt.net>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LOCAL\-FETCH" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-LOCAL\-FETCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LOG" "1" "07/14/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
+.TH "GIT\-LOG" "1" "07/19/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LOST\-FOUND" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-LOST\-FOUND" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Suppose you run \fIgit tag \-f\fR and mistype the tag to overwrite. The ref to your tag is overwritten, but until you run \fIgit prune\fR, the tag itself is still there.
.sp
.nf
+.ft C
$ git lost\-found
[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
...
+.ft
+
.fi
Also you can use gitk to browse how any tags found relate to each other.
.sp
.nf
+.ft C
$ gitk $(cd .git/lost\-found/commit && echo ??*)
+.ft
+
.fi
After making sure you know which the object is the tag you are looking for, you can reconnect it to your regular .git/refs hierarchy.
.sp
.nf
+.ft C
$ git cat\-file \-t 1ef2b196
tag
$ git cat\-file tag 1ef2b196
$ git update\-ref refs/tags/not\-lost\-anymore 1ef2b196
$ git rev\-parse not\-lost\-anymore
1ef2b196d909eed523d4f3c9bf54b78cdd6843c6
+.ft
+
.fi
.SH "AUTHOR"
Written by Junio C Hamano 濱野 純 <junkio@cox.net>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LS\-FILES" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-LS\-FILES" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LS\-REMOTE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-LS\-REMOTE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-LS\-TREE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-LS\-TREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MAILINFO" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MAILINFO" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MAILSPLIT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MAILSPLIT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE\-BASE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGE\-BASE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE\-FILE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGE\-FILE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE\-INDEX" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGE\-INDEX" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE\-ONE\-FILE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGE\-ONE\-FILE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE\-TREE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGE\-TREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGE" "1" "07/13/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
+.TH "GIT\-MERGE" "1" "07/19/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MERGETOOL" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MERGETOOL" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MKTAG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MKTAG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MKTREE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MKTREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-MV" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-MV" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-NAME\-REV" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-NAME\-REV" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Enter git\-name\-rev:
.sp
.nf
+.ft C
% git name\-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940
+.ft
+
.fi
Now you are wiser, because you know that it happened 940 revisions before v0.99.
Another nice thing you can do is:
.sp
.nf
+.ft C
% git log | git name\-rev \-\-stdin
+.ft
+
.fi
.SH "AUTHOR"
Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PACK\-OBJECTS" "1" "07/13/2007" "Git 1.5.3.rc1" "Git Manual"
+.TH "GIT\-PACK\-OBJECTS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PACK\-REDUNDANT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PACK\-REDUNDANT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PACK\-REFS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PACK\-REFS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PARSE\-REMOTE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PARSE\-REMOTE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PATCH\-ID" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PATCH\-ID" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PEEK\-REMOTE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PEEK\-REMOTE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PRUNE\-PACKED" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PRUNE\-PACKED" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PRUNE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-PRUNE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
To prune objects not used by your repository nor another that borrows from your repository via its .git/objects/info/alternates:
.sp
.nf
+.ft C
$ git prune $(cd ../another && $(git\-rev\-parse \-\-all))
+.ft
+
.fi
.SH "AUTHOR"
Written by Linus Torvalds <torvalds@osdl.org>
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PULL" "1" "07/06/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
+.TH "GIT\-PULL" "1" "07/19/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-PUSH" "1" "07/06/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
+.TH "GIT\-PUSH" "1" "07/19/2007" "Git 1.5.3.rc0.39.g46f7" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-QUILTIMPORT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-QUILTIMPORT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-READ\-TREE" "1" "06/21/2007" "Git 1.5.2.2.249.g45fd" "Git Manual"
+.TH "GIT\-READ\-TREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
This means that you can do
.sp
.nf
+.ft C
$ git\-read\-tree \-m <tree1> <tree2> <tree3>
+.ft
+
.fi
and you will end up with an index with all of the <tree1> entries in "stage1", all of the <tree2> entries in "stage2" and all of the <tree3> entries in "stage3". When performing a merge of another branch into the current branch, we use the common ancestor tree as <tree1>, the current branch head as <tree2>, and the other branch head as <tree3>.
This is done to prevent you from losing your work\-in\-progress changes, and mixing your random changes in an unrelated merge commit. To illustrate, suppose you start from what has been committed last to your repository:
.sp
.nf
+.ft C
$ JC=`git\-rev\-parse \-\-verify "HEAD^0"`
$ git\-checkout\-index \-f \-u \-a $JC
+.ft
+
.fi
You do random edits, without running git\-update\-index. And then you notice that the tip of your "upstream" tree has advanced since you pulled from him:
.sp
.nf
+.ft C
$ git\-fetch git://.... linus
$ LT=`cat .git/FETCH_HEAD`
+.ft
+
.fi
Your work tree is still based on your HEAD ($JC), but you have some edits since. Three\-way merge makes sure that you have not added or modified index entries since $JC, and if you haven't, then does the right thing. So with the following sequence:
.sp
.nf
+.ft C
$ git\-read\-tree \-m \-u `git\-merge\-base $JC $LT` $JC $LT
$ git\-merge\-index git\-merge\-one\-file \-a
$ echo "Merge with Linus" | \\
git\-commit\-tree `git\-write\-tree` \-p $JC \-p $LT
+.ft
+
.fi
what you would commit is a pure merge between $JC and $LT without your work\-in\-progress changes, and your work tree would be updated to the result of the merge.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REBASE" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-REBASE" "1" "07/19/2007" "Git 1.5.3.rc0" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RECEIVE\-PACK" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-RECEIVE\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REFLOG" "1" "06/21/2007" "Git 1.5.2.2.249.g45fd" "Git Manual"
+.TH "GIT\-REFLOG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RELINK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-RELINK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REMOTE" "1" "07/01/2007" "Git 1.5.2.2.619.g06f59" "Git Manual"
+.TH "GIT\-REMOTE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Add a new remote, fetch, and check out a branch from it
.sp
.nf
+.ft C
$ git remote
origin
$ git branch \-r
linux\-nfs/master
$ git checkout \-b nfs linux\-nfs/master
...
+.ft
+
.fi
.TP
\(bu
Imitate \fIgit clone\fR but track only selected branches
.sp
.nf
+.ft C
$ mkdir project.git
$ cd project.git
$ git init
$ git remote add \-f \-t master \-m master origin git://example.com/git.git/
$ git merge origin
+.ft
+
.fi
.SH "SEE ALSO"
\fBgit\-fetch\fR(1) \fBgit\-branch\fR(1) \fBgit\-config\fR(1)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REPACK" "1" "07/13/2007" "Git 1.5.3.rc1" "Git Manual"
+.TH "GIT\-REPACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REPO\-CONFIG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-REPO\-CONFIG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REQUEST\-PULL" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-REQUEST\-PULL" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RERERE" "1" "07/07/2007" "Git 1.5.3.rc0.63.gc956" "Git Manual"
+.TH "GIT\-RERERE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
When your topic branch modifies overlapping area that your master branch (or upstream) touched since your topic branch forked from it, you may want to test it with the latest master, even before your topic branch is ready to be pushed upstream:
.sp
.nf
+.ft C
o\-\-\-*\-\-\-o topic
/
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o master
+.ft
+
.fi
For such a test, you need to merge master and topic somehow. One way to do it is to pull master into the topic branch:
.sp
.nf
+.ft C
$ git checkout topic
$ git merge master
o\-\-\-*\-\-\-o\-\-\-+ topic
/ /
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o master
+.ft
+
.fi
The commits marked with * touch the same area in the same file; you need to resolve the conflicts when creating the commit marked with +. Then you can test the result to make sure your work\-in\-progress still works with what is in the latest master.
After this test merge, there are two ways to continue your work on the topic. The easiest is to build on top of the test merge commit +, and when your work in the topic branch is finally ready, pull the topic branch into master, and/or ask the upstream to pull from you. By that time, however, the master or the upstream might have been advanced since the test merge +, in which case the final commit graph would look like this:
.sp
.nf
+.ft C
$ git checkout topic
$ git merge master
$ ... work on both topic and master branches
o\-\-\-*\-\-\-o\-\-\-+\-\-\-o\-\-\-o topic
/ / \\
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o\-\-\-o\-\-\-o\-\-\-+ master
+.ft
+
.fi
When your topic branch is long\-lived, however, your topic branch would end up having many such "Merge from master" commits on it, which would unnecessarily clutter the development history. Readers of the Linux kernel mailing list may remember that Linus complained about such too frequent test merges when a subsystem maintainer asked to pull from a branch full of "useless merges".
As an alternative, to keep the topic branch clean of test merges, you could blow away the test merge, and keep building on top of the tip before the test merge:
.sp
.nf
+.ft C
$ git checkout topic
$ git merge master
$ git reset \-\-hard HEAD^ ;# rewind the test merge
o\-\-\-*\-\-\-o\-\-\-\-\-\-\-o\-\-\-o topic
/ \\
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o\-\-\-o\-\-\-o\-\-\-+ master
+.ft
+
.fi
This would leave only one merge commit when your topic branch is finally ready and merged into the master branch. This merge would require you to resolve the conflict, introduced by the commits marked with *. However, often this conflict is the same conflict you resolved when you created the test merge you blew away. git\-rerere command helps you to resolve this final conflicted merge using the information from your earlier hand resolve.
The information git\-rerere records is also used when running git\-rebase. After blowing away the test merge and continuing development on the topic branch:
.sp
.nf
+.ft C
o\-\-\-*\-\-\-o\-\-\-\-\-\-\-o\-\-\-o topic
/
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o\-\-\-o\-\-\-o master
o\-\-\-*\-\-\-o\-\-\-\-\-\-\-o\-\-\-o topic
/
o\-\-\-o\-\-\-o\-\-\-*\-\-\-o\-\-\-o\-\-\-o\-\-\-o master
+.ft
+
.fi
you could run git rebase master topic, to keep yourself up\-to\-date even before your topic is ready to be sent upstream. This would result in falling back to three\-way merge, and it would conflict the same way the test merge you resolved earlier. git\-rerere is run by git rebase to help you resolve this conflict.
.SH "AUTHOR"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RESET" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-RESET" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Undo a commit and redo
.sp
.nf
+.ft C
$ git commit ...
$ git reset \-\-soft HEAD^ \fB(1)\fR
$ edit \fB(2)\fR
$ git commit \-a \-c ORIG_HEAD \fB(3)\fR
+.ft
+
.fi
.sp
\fB1. \fRThis is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".
Undo commits permanently
.sp
.nf
+.ft C
$ git commit ...
$ git reset \-\-hard HEAD~3 \fB(1)\fR
+.ft
+
.fi
.sp
\fB1. \fRThe last three commits (HEAD, HEAD^, and HEAD~2) were bad and you do not want to ever see them again. Do \fBnot\fR do this if you have already given these commits to somebody else.
Undo a commit, making it a topic branch
.sp
.nf
+.ft C
$ git branch topic/wip \fB(1)\fR
$ git reset \-\-hard HEAD~3 \fB(2)\fR
$ git checkout topic/wip \fB(3)\fR
+.ft
+
.fi
.sp
\fB1. \fRYou have made some commits, but realize they were premature to be in the "master" branch. You want to continue polishing them in a topic branch, so create "topic/wip" branch off of the current HEAD.
Undo add
.sp
.nf
+.ft C
$ edit \fB(1)\fR
$ git add frotz.c filfre.c
$ mailx \fB(2)\fR
$ git reset \fB(3)\fR
$ git pull git://info.example.com/ nitfol \fB(4)\fR
+.ft
+
.fi
.sp
\fB1. \fRyou are happily working on something, and find the changes in these files are in good order. You do not want to see them when you run "git diff", because you plan to work on other files and changes with these files are distracting.
Undo a merge or pull
.sp
.nf
+.ft C
$ git pull \fB(1)\fR
Auto\-merging nitfol
CONFLICT (content): Merge conflict in nitfol
Updating from 41223... to 13134...
Fast forward
$ git reset \-\-hard ORIG_HEAD \fB(4)\fR
+.ft
+
.fi
.sp
\fB1. \fRtry to update from the upstream resulted in a lot of conflicts; you were not ready to spend a lot of time merging right now, so you decide to do that later.
Suppose you are interrupted by an urgent fix request while you are in the middle of a large change. The files in your working tree are not in any shape to be committed yet, but you need to get to the other branch for a quick bugfix.
.sp
.nf
+.ft C
$ git checkout feature ;# you were working in "feature" branch and
$ work work work ;# got interrupted
$ git commit \-a \-m 'snapshot WIP' \fB(1)\fR
$ git checkout feature
$ git reset \-\-soft HEAD^ ;# go back to WIP state \fB(2)\fR
$ git reset \fB(3)\fR
+.ft
+
.fi
.sp
\fB1. \fRThis commit will get blown away so a throw\-away log message is OK.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REV\-LIST" "1" "07/14/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
+.TH "GIT\-REV\-LIST" "1" "07/19/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REV\-PARSE" "1" "07/02/2007" "Git 1.5.2.2.646.g71e55" "Git Manual"
+.TH "GIT\-REV\-PARSE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-REVERT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-REVERT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RM" "1" "07/14/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
+.TH "GIT\-RM" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-RUNSTATUS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-RUNSTATUS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SEND\-EMAIL" "1" "06/28/2007" "Git 1.5.2.2.590.gf578" "Git Manual"
+.TH "GIT\-SEND\-EMAIL" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SEND\-PACK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SEND\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SH\-SETUP" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SH\-SETUP" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHELL" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SHELL" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHORTLOG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SHORTLOG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHOW\-BRANCH" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SHOW\-BRANCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
The following example shows three branches, "master", "fixes" and "mhf":
.sp
.nf
+.ft C
$ git show\-branch master fixes mhf
* [master] Add 'git show\-branch'.
! [fixes] Introduce "reset type" flag to "git reset"
+ [mhf~7] Multi\-head fetch.
+ [mhf~8] Start adding the $GIT_DIR/remotes/ support.
*++ [master] Add 'git show\-branch'.
+.ft
+
.fi
These three branches all forked from a common commit, [master], whose commit message is "Add \fIgit show\-branch\fR. "fixes" branch adds one commit \fIIntroduce "reset type"\fR. "mhf" branch has many other commits. The current branch is "master".
.SH "EXAMPLE"
If you keep your primary branches immediately under $GIT_DIR/refs/heads, and topic branches in subdirectories of it, having the following in the configuration file may help:
.sp
.nf
+.ft C
[showbranch]
default = \-\-topo\-order
default = heads/*
+.ft
+
.fi
With this, git show\-branch without extra parameters would show only the primary branches. In addition, if you happen to be on your topic branch, it is shown as well.
.sp
.nf
+.ft C
$ git show\-branch \-\-reflog='10,1 hour ago' \-\-list master
+.ft
+
.fi
shows 10 reflog entries going back from the tip as of 1 hour ago. Without \-\-list, the output also shows how these tips are topologically related with each other.
.SH "AUTHOR"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHOW\-INDEX" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SHOW\-INDEX" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHOW\-REF" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SHOW\-REF" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
The output is in the format: \fI<SHA\-1 ID>\fR \fI<space>\fR \fI<reference name>\fR.
.sp
.nf
+.ft C
$ git show\-ref \-\-head \-\-dereference
832e76a9899f560a90ffd62ae2ce83bbeff58f54 HEAD
832e76a9899f560a90ffd62ae2ce83bbeff58f54 refs/heads/master
055e4ae3ae6eb344cbabf2a5256a49ea66040131 refs/tags/v1.0rc4
423325a2d24638ddcc82ce47be5e40be550f4507 refs/tags/v1.0rc4^{}
...
+.ft
+
.fi
When using \-\-hash (and not \-\-dereference) the output format is: \fI<SHA\-1 ID>\fR
.sp
.nf
+.ft C
$ git show\-ref \-\-heads \-\-hash
2e3ba0114a1f52b47df29743d6915d056be13278
185008ae97960c8d551adcd9e23565194651b5d1
03adf42c988195b50e1a1935ba5fcbc39b2b029b
...
+.ft
+
.fi
.SH "EXAMPLE"
To show all references called "master", whether tags or heads or anything else, and regardless of how deep in the reference naming hierarchy they are, use:
.sp
.nf
+.ft C
git show\-ref master
+.ft
+
.fi
This will show "refs/heads/master" but also "refs/remote/other\-repo/master", if such references exists.
When using the \fI\-\-verify\fR flag, the command requires an exact path:
.sp
.nf
+.ft C
git show\-ref \-\-verify refs/heads/master
+.ft
+
.fi
will only match the exact branch called "master".
For scripting, you can ask it to be quiet with the "\-\-quiet" flag, which allows you to do things like
.sp
.nf
+.ft C
git\-show\-ref \-\-quiet \-\-verify \-\- "refs/heads/$headname" ||
echo "$headname is not a valid branch"
+.ft
+
.fi
to check whether a particular branch exists or not (notice how we don't actually want to show any results, and we want to use the full refname for it in order to not trigger the problem with ambiguous partial matches).
To do automatic tag object dereferencing, use the "\-d" or "\-\-dereference" flag, so you can do
.sp
.nf
+.ft C
git show\-ref \-\-tags \-\-dereference
+.ft
+
.fi
to get a listing of all tags together with what they dereference.
.SH "SEE ALSO"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SHOW" "1" "07/14/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
+.TH "GIT\-SHOW" "1" "07/19/2007" "Git 1.5.3.rc1.16.g9d6f" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SSH\-FETCH" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-SSH\-FETCH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SSH\-UPLOAD" "1" "07/03/2007" "Git 1.5.3.rc0" "Git Manual"
+.TH "GIT\-SSH\-UPLOAD" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-STASH" "1" "07/05/2007" "Git 1.5.3.rc0.30.g114f" "Git Manual"
+.TH "GIT\-STASH" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.SH "SYNOPSIS"
.sp
.nf
-\fIgit\-stash\fR (save | list | show [<stash>] | apply [<stash>] | clear)
+\fIgit\-stash\fR (list | show [<stash>] | apply [<stash>] | clear)
+\fIgit\-stash\fR [save] [message\&...]
.fi
.SH "DESCRIPTION"
Use \fIgit\-stash\fR when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
-The modifications stashed away by this command can be listed with git\-stash list, inspected with git\-stash show, and restored (potentially on top of a different commit) with git\-stash apply. Calling git\-stash without any arguments is equivalent to git\-stash save.
+The modifications stashed away by this command can be listed with git\-stash list, inspected with git\-stash show, and restored (potentially on top of a different commit) with git\-stash apply. Calling git\-stash without any arguments is equivalent to git\-stash save. A stash is by default listed as "WIP on \fIbranchname\fR \&...", but you can give a more descriptive message on the command line when you create one.
The latest stash you created is stored in $GIT_DIR/refs/stash; older stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. stash@{1} is the most recently created stash, stash@{2} is the one before it, stash@{2.hours.ago} is also possible).
.SH "OPTIONS"
List the stashes that you currently have. Each \fIstash\fR is listed with its name (e.g. stash@{0} is the latest stash, `stash@{1} is the one before, etc.), the name of the branch that was current when the stash was made, and a short description of the commit the stash was based on.
.sp
.nf
-stash@{0}: submit: 6ebd0e2... Add git\-stash
-stash@{1}: master: 9cc0589... Merge branch 'master' of gfi
+.ft C
+stash@{0}: WIP on submit: 6ebd0e2... Update git\-stash documentation
+stash@{1}: On master: 9cc0589... Add git\-stash
+.ft
+
.fi
.TP
show [<stash>]
However, there are cases in which your local changes do conflict with the upstream changes, and git pull refuses to overwrite your changes. In such a case, you can stash your changes away, perform a pull, and then unstash, like this:
.sp
.nf
+.ft C
$ git pull
...
file foobar not up to date, cannot merge.
$ git stash
$ git pull
$ git stash apply
+.ft
+
.fi
.TP
Interrupted workflow
When you are in the middle of something, your boss comes in and demands that you fix something immediately. Traditionally, you would make a commit to a temporary branch to store your changes away, and return to your original branch to make the emergency fix, like this:
.sp
.nf
+.ft C
... hack hack hack ...
$ git checkout \-b my_wip
$ git commit \-a \-m "WIP"
$ git checkout my_wip
$ git reset \-\-soft HEAD^
... continue hacking ...
+.ft
+
.fi
You can use git\-stash to simplify the above, like this:
.sp
.nf
+.ft C
... hack hack hack ...
$ git stash
$ edit emergency fix
$ git commit \-a \-m "Fix in a hurry"
$ git stash apply
... continue hacking ...
+.ft
+
.fi
.SH "SEE ALSO"
\fBgit\-checkout\fR(1), \fBgit\-commit\fR(1), \fBgit\-reflog\fR(1), \fBgit\-reset\fR(1)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-STATUS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-STATUS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-STRIPSPACE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-STRIPSPACE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SUBMODULE" "1" "07/07/2007" "Git 1.5.3.rc0.63.gc956" "Git Manual"
+.TH "GIT\-SUBMODULE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SVN" "1" "06/24/2007" "Git 1.5.2.2.549.gaeb59" "Git Manual"
+.TH "GIT\-SVN" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Syntax is compatible with the files used by git\-svnimport and git\-cvsimport:
.sp
.nf
+.ft C
loginname = Joe User <user@example.com>
+.ft
+
.fi
If this option is specified and git\-svn encounters an SVN committer name that does not exist in the authors\-file, git\-svn will abort operation. The user will then have to add the appropriate entry. Re\-running the previous git\-svn command after the authors\-file is modified should continue operation.
Tracking and contributing to a the trunk of a Subversion\-managed project:
.sp
.nf
+.ft C
# Clone a repo (like git clone):
git\-svn clone http://svn.foo.org/project/trunk
# Enter the newly cloned directory:
git\-svn dcommit
# Append svn:ignore settings to the default git exclude file:
git\-svn show\-ignore >> .git/info/exclude
+.ft
+
.fi
Tracking and contributing to an entire Subversion\-managed project (complete with a trunk, tags and branches):
.sp
.nf
+.ft C
# Clone a repo (like git clone):
git\-svn clone http://svn.foo.org/project \-T trunk \-b branches \-t tags
# View all branches and tags you have cloned:
git reset \-\-hard remotes/trunk
# You may only dcommit to one branch/tag/trunk at a time. The usage
# of dcommit/rebase/show\-ignore should be the same as above.
+.ft
+
.fi
.SH "REBASE VS. PULL/MERGE"
Originally, git\-svn recommended that the remotes/git\-svn branch be pulled or merged from. This is because the author favored \fIgit\-svn set\-tree B\fR to commit a single head rather than the \fIgit\-svn set\-tree A..B\fR notation to commit multiple commits.
git\-svn stores [svn\-remote] configuration information in the repository .git/config file. It is similar the core git [remote] sections except \fIfetch\fR keys do not accept glob arguments; but they are instead handled by the \fIbranches\fR and \fItags\fR keys. Since some SVN repositories are oddly configured with multiple projects glob expansions such those listed below are allowed:
.sp
.nf
+.ft C
[svn\-remote "project\-a"]
url = http://server.org/svn
branches = branches/*/project\-a:refs/remotes/project\-a/branches/*
tags = tags/*/project\-a:refs/remotes/project\-a/tags/*
trunk = trunk/project\-a:refs/remotes/project\-a/trunk
+.ft
+
.fi
Keep in mind that the \fI\fR\fI (asterisk) wildcard of the local ref (left of the \fR\fI\fI:\fR\fR\fI) *must\fR be the farthest right path component; however the remote wildcard may be anywhere as long as it's own independent path componet (surrounded by \fI/\fR or EOL). This type of configuration is not automatically created by \fIinit\fR and should be manually entered with a text\-editor or using \fBgit\-config\fR(1)
.SH "SEE ALSO"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SVNIMPORT" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SVNIMPORT" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
Read a file with lines on the form
.sp
.nf
+.ft C
username = User's Full Name <email@addr.es>
+.ft
+
.fi
and use "User's Full Name <email@addr.es>" as the GIT author and committer for Subversion commits made by "username". If encountering a commit made by a user not in the list, abort.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-SYMBOLIC\-REF" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-SYMBOLIC\-REF" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-TAG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-TAG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
By default, git\-tag in sign\-with\-default mode (\-s) will use your committer identity (of the form "Your Name <your@email.address>") to find a key. If you want to use a different default key, you can specify it in the repository configuration as follows:
.sp
.nf
+.ft C
[user]
signingkey = <gpg\-key\-id>
+.ft
+
.fi
.SH "DISCUSSION"
.SS "On Re\-tagging"
If somebody got a release tag from you, you cannot just change the tag for them by updating your own one. This is a big security issue, in that people MUST be able to trust their tag\-names. If you really want to do the insane thing, you need to just fess up to it, and tell people that you messed up. You can do that by making a very public announcement saying:
.sp
.nf
+.ft C
Ok, I messed up, and I pushed out an earlier version tagged as X. I
then fixed something, and retagged the *fixed* tree as X again.
which should return 0123456789abcdef.. if you have the new version.
Sorry for inconvenience.
+.ft
+
.fi
Does this seem a bit complicated? It \fBshould\fR be. There is no way that it would be correct to just "fix" it behind peoples backs. People need to know that their tags might have been changed.
.SS "On Automatic following"
You would notice "please pull" messages on the mailing list says repo URL and branch name alone. This is designed to be easily cut&pasted to "git fetch" command line:
.sp
.nf
+.ft C
Linus, please pull from
git://git..../proj.git master
to get the following updates...
+.ft
+
.fi
becomes:
.sp
.nf
+.ft C
$ git pull git://git..../proj.git master
+.ft
+
.fi
In such a case, you do not want to automatically follow other's tags.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-TAR\-TREE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-TAR\-TREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UNPACK\-FILE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UNPACK\-FILE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UNPACK\-OBJECTS" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UNPACK\-OBJECTS" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UPDATE\-INDEX" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UPDATE\-INDEX" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
To pretend you have a file with mode and sha1 at path, say:
.sp
.nf
+.ft C
$ git\-update\-index \-\-cacheinfo mode sha1 path
+.ft
+
.fi
\fI\-\-info\-only\fR is used to register files without placing them in the object database. This is useful for status\-only repositories.
For example, starting with this index:
.sp
.nf
+.ft C
$ git ls\-files \-s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0 frotz
+.ft
+
.fi
you can feed the following input to \-\-index\-info:
.sp
.nf
+.ft C
$ git update\-index \-\-index\-info
0 0000000000000000000000000000000000000000 frotz
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
+.ft
+
.fi
The first line of the input feeds 0 as the mode to remove the path; the SHA1 does not matter as long as it is well formatted. Then the second and third line feeds stage 1 and stage 2 entries for that path. After the above, we would end up with this:
.sp
.nf
+.ft C
$ git ls\-files \-s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1 frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz
+.ft
+
.fi
.SH "USING \(lqASSUME UNCHANGED\(rq BIT"
Many operations in git depend on your filesystem to have an efficient lstat(2) implementation, so that st_mtime information for working tree files can be cheaply checked to see if the file contents have changed from the version recorded in the index file. Unfortunately, some filesystems have inefficient lstat(2). If your filesystem is one of them, you can set "assume unchanged" bit to paths you have not changed to cause git not to do this check. Note that setting this bit on a path does not mean git will check the contents of the file to see if it has changed \(em it makes git to omit any checking and assume it has \fBnot\fR changed. When you make changes to working tree files, you have to explicitly tell git about it by dropping "assume unchanged" bit, either before or after you modify them.
To update and refresh only the files already checked out:
.sp
.nf
+.ft C
$ git\-checkout\-index \-n \-f \-a && git\-update\-index \-\-ignore\-missing \-\-refresh
+.ft
+
.fi
.TP
On an inefficient filesystem with core.ignorestat set
.sp
.nf
+.ft C
$ git update\-index \-\-really\-refresh \fB(1)\fR
$ git update\-index \-\-no\-assume\-unchanged foo.c \fB(2)\fR
$ git diff \-\-name\-only \fB(3)\fR
$ git update\-index \-\-no\-assume\-unchanged foo.c \fB(8)\fR
$ git diff \-\-name\-only \fB(9)\fR
M foo.c
+.ft
+
.fi
.sp
\fB1. \fRforces lstat(2) to set "assume unchanged" bits for paths that match index.
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UPDATE\-REF" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UPDATE\-REF" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UPDATE\-SERVER\-IN" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UPDATE\-SERVER\-IN" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UPLOAD\-ARCHIVE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UPLOAD\-ARCHIVE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-UPLOAD\-PACK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-UPLOAD\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-VAR" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-VAR" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-VERIFY\-PACK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-VERIFY\-PACK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-VERIFY\-TAG" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-VERIFY\-TAG" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-WHATCHANGED" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-WHATCHANGED" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT\-WRITE\-TREE" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GIT\-WRITE\-TREE" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GITK" "1" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GITK" "1" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GITATTRIBUTES" "5" "07/09/2007" "Git 1.5.3.rc0.81.g1ed84" "Git Manual"
+.TH "GITATTRIBUTES" "5" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
To define a custom diff driver jcdiff, add a section to your $GIT_DIR/config file (or $HOME/.gitconfig file) like this:
.sp
.nf
+.ft C
[diff "jcdiff"]
command = j\-c\-diff
+.ft
+
.fi
When git needs to show you a diff for the path with diff attribute set to jcdiff, it calls the command you specified with the above configuration, i.e. j\-c\-diff, with 7 parameters, just like GIT_EXTERNAL_DIFF program is called. See \fBgit\fR(7) for details.
.RE
First in .gitattributes, you would assign the diff attribute for paths.
.sp
.nf
+.ft C
*.tex diff=tex
+.ft
+
.fi
Then, you would define "diff.tex.funcname" configuration to specify a regular expression that matches a line that you would want to appear as the hunk header, like this:
.sp
.nf
+.ft C
[diff "tex"]
funcname = "^\\\\(\\\\\\\\\\\\(sub\\\\)*section{.*\\\\)$"
+.ft
+
.fi
Note. A single level of backslashes are eaten by the configuration file parser, so you would need to double the backslashes; the pattern above picks a line that begins with a backslash, and zero or more occurences of sub followed by section followed by open brace, to the end of line.
To define a custom merge driver filfre, add a section to your $GIT_DIR/config file (or $HOME/.gitconfig file) like this:
.sp
.nf
+.ft C
[merge "filfre"]
name = feel\-free merge driver
driver = filfre %O %A %B
recursive = binary
+.ft
+
.fi
The merge.*.name variable gives the driver a human\-readable name.
If you have these three gitattributes file:
.sp
.nf
+.ft C
(in $GIT_DIR/info/attributes)
a* foo !bar \-baz
ab* merge=filfre
abc \-foo \-bar
*.c frotz
+.ft
+
.fi
the attributes given to path t/abc are computed as follows:
.TP 3
As the result, the attributes assignement to t/abc becomes:
.sp
.nf
+.ft C
foo set to true
bar unspecified
baz set to false
merge set to string value "filfre"
frotz unspecified
+.ft
+
.fi
.SH "GIT"
Part of the \fBgit\fR(7) suite
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GITIGNORE" "5" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GITIGNORE" "5" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
An example:
.sp
.nf
+.ft C
$ git\-status
[...]
# Untracked files:
[...]
# Documentation/foo.html
[...]
+.ft
+
.fi
Another example:
.sp
.nf
+.ft C
$ cat .gitignore
vmlinux*
$ ls arch/foo/kernel/vm*
arch/foo/kernel/vmlinux.lds.S
$ echo '!/vmlinux*' >arch/foo/kernel/.gitignore
+.ft
+
.fi
The second .gitignore prevents git from ignoring arch/foo/kernel/vmlinux.lds.S.
.SH "DOCUMENTATION"
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GITMODULES" "5" "06/16/2007" "Git 1.5.2.2.236.g952c8" "Git Manual"
+.TH "GITMODULES" "5" "07/19/2007" "Git 1.5.3.rc2.19.gc4fba" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "GIT" "7" "07/13/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
+.TH "GIT" "7" "07/19/2007" "Git 1.5.3.rc1.4.gaf83" "Git Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)