on the subcommand:</p>\r
<div class="literalblock">\r
<div class="content">\r
-<pre><tt>git bisect start [<paths>...]\r
+<pre><tt>git bisect start [<bad> [<good>...]] [--] [<paths>...]\r
git bisect bad <rev>\r
git bisect good <rev>\r
git bisect reset [<branch>]\r
</div></div>\r
<p>Then compile and test the one you chose to try. After that, tell\r
bisect what the result was as usual.</p>\r
-<h3>Cutting down bisection by giving path parameter to bisect start</h3>\r
+<h3>Cutting down bisection by giving more parameters to bisect start</h3>\r
<p>You can further cut down the number of trials if you know what part of\r
the tree is involved in the problem you are tracking down, by giving\r
paths parameters when you say <tt>bisect start</tt>, like this:</p>\r
<div class="listingblock">\r
<div class="content">\r
-<pre><tt>$ git bisect start arch/i386 include/asm-i386</tt></pre>\r
+<pre><tt>$ git bisect start -- arch/i386 include/asm-i386</tt></pre>\r
+</div></div>\r
+<p>If you know beforehand more than one good commits, you can narrow the\r
+bisect space down without doing the whole tree checkout every time you\r
+give good commits. You give the bad revision immediately after <tt>start</tt>\r
+and then you give all the good revisions you have:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>$ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 --\r
+ # v2.6.20-rc6 is bad\r
+ # v2.6.20-rc4 and v2.6.20-rc1 are good</tt></pre>\r
</div></div>\r
<h3>Bisect run</h3>\r
<p>If you have a script that can tell if the current source code is good\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 04-Apr-2007 18:33:26 UTC\r
+Last updated 07-Apr-2007 10:17:28 UTC\r
</div>\r
</div>\r
</body>\r
The command takes various subcommands, and different options depending
on the subcommand:
- git bisect start [<paths>...]
+ git bisect start [<bad> [<good>...]] [--] [<paths>...]
git bisect bad <rev>
git bisect good <rev>
git bisect reset [<branch>]
Then compile and test the one you chose to try. After that, tell
bisect what the result was as usual.
-Cutting down bisection by giving path parameter to bisect start
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+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:
------------
-$ git bisect start arch/i386 include/asm-i386
+$ git bisect start -- arch/i386 include/asm-i386
+------------
+
+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:
+
+------------
+$ 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
------------
Bisect run
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
<div class="verseblock">\r
-<div class="content"><em>git-cvsimport</em> [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]\r
- [-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]\r
- [-m] [-M regex] [<CVS_module>]</div></div>\r
+<div class="content"><em>git-cvsimport</em> [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]\r
+ [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]\r
+ [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]\r
+ [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]\r
+ [<CVS_module>]</div></div>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
<div class="sectionbody">\r
<dl>\r
<dt>\r
+-v\r
+</dt>\r
+<dd>\r
+<p>\r
+ Verbosity: let <em>cvsimport</em> report what it is doing.\r
+</p>\r
+</dd>\r
+<dt>\r
-d <CVSROOT>\r
</dt>\r
<dd>\r
<p>\r
The root of the CVS archive. May be local (a simple path) or remote;\r
currently, only the :local:, :ext: and :pserver: access methods\r
- are supported.\r
+ are supported. If not given, git-cvsimport will try to read it\r
+ from <tt>CVS/Root</tt>. If no such file exists, it checks for the\r
+ <tt>CVSROOT</tt> environment variable.\r
+</p>\r
+</dd>\r
+<dt>\r
+<CVS_module>\r
+</dt>\r
+<dd>\r
+<p>\r
+ The CVS module you want to import. Relative to <CVSROOT>.\r
+ If not given, git-cvsimport tries to read it from\r
+ <tt>CVS/Repository</tt>.\r
</p>\r
</dd>\r
<dt>\r
</p>\r
</dd>\r
<dt>\r
+-o <branch-for-HEAD>\r
+</dt>\r
+<dd>\r
+<p>\r
+ The <em>HEAD</em> branch from CVS is imported to the <em>origin</em> branch within\r
+ the git repository, as <em>HEAD</em> already has a special meaning for git.\r
+ Use this option if you want to import into a different branch.\r
+</p>\r
+<p>Use <em>-o master</em> for continuing an import that was initially done by\r
+the old cvs2git tool.</p>\r
+</dd>\r
+<dt>\r
-i\r
</dt>\r
<dd>\r
</dt>\r
<dd>\r
<p>\r
- Kill keywords: will extract files with -kk from the CVS archive\r
+ Kill keywords: will extract files with <em>-kk</em> from the CVS archive\r
to avoid noisy changesets. Highly recommended, but off by default\r
to preserve compatibility with early imported trees.\r
</p>\r
</p>\r
</dd>\r
<dt>\r
--o <branch-for-HEAD>\r
+-s <subst>\r
</dt>\r
<dd>\r
<p>\r
- The <em>HEAD</em> branch from CVS is imported to the <em>origin</em> branch within\r
- the git repository, as <em>HEAD</em> already has a special meaning for git.\r
- Use this option if you want to import into a different branch.\r
+ Substitute the character "/" in branch names with <subst>\r
</p>\r
-<p>Use <em>-o master</em> for continuing an import that was initially done by\r
-the old cvs2git tool.</p>\r
</dd>\r
<dt>\r
-p <options-for-cvsps>\r
<p>If you need to pass multiple options, separate them with a comma.</p>\r
</dd>\r
<dt>\r
+-z <fuzz>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Pass the timestamp fuzz factor to cvsps, in seconds. If unset,\r
+ cvsps defaults to 300s.\r
+</p>\r
+</dd>\r
+<dt>\r
-P <cvsps-output-file>\r
</dt>\r
<dd>\r
<dd>\r
<p>\r
Attempt to detect merges based on the commit message with a custom\r
- regex. It can be used with -m to also see the default regexes.\r
+ regex. It can be used with <em>-m</em> to also see the default regexes.\r
You must escape forward slashes.\r
</p>\r
</dd>\r
<dt>\r
--v\r
-</dt>\r
-<dd>\r
-<p>\r
- Verbosity: let <em>cvsimport</em> report what it is doing.\r
-</p>\r
-</dd>\r
-<dt>\r
-<CVS_module>\r
-</dt>\r
-<dd>\r
-<p>\r
- The CVS module you want to import. Relative to <CVSROOT>.\r
-</p>\r
-</dd>\r
-<dt>\r
--h\r
-</dt>\r
-<dd>\r
-<p>\r
- Print a short usage message and exit.\r
-</p>\r
-</dd>\r
-<dt>\r
--z <fuzz>\r
-</dt>\r
-<dd>\r
-<p>\r
- Pass the timestamp fuzz factor to cvsps, in seconds. If unset,\r
- cvsps defaults to 300s.\r
-</p>\r
-</dd>\r
-<dt>\r
--s <subst>\r
+-S <regex>\r
</dt>\r
<dd>\r
<p>\r
- Substitute the character "/" in branch names with <subst>\r
+ Skip paths matching the regex.\r
</p>\r
</dd>\r
<dt>\r
</p>\r
</dd>\r
<dt>\r
--S <regex>\r
-</dt>\r
-<dd>\r
-<p>\r
- Skip paths matching the regex.\r
-</p>\r
-</dd>\r
-<dt>\r
-L <limit>\r
</dt>\r
<dd>\r
<p>git-cvsimport will make it appear as those authors had\r
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly\r
all along.</p>\r
-<p>For convenience, this data is saved to $GIT_DIR/cvs-authors\r
-each time the -A option is provided and read from that same\r
+<p>For convenience, this data is saved to <tt>$GIT_DIR/cvs-authors</tt>\r
+each time the <em>-A</em> option is provided and read from that same\r
file each time git-cvsimport is run.</p>\r
<p>It is not recommended to use this feature if you intend to\r
export changes back to CVS again later with\r
<a href="git-cvsexportcommit.html">git-cvsexportcommit(1)</a>.</p>\r
</dd>\r
+<dt>\r
+-h\r
+</dt>\r
+<dd>\r
+<p>\r
+ Print a short usage message and exit.\r
+</p>\r
+</dd>\r
</dl>\r
</div>\r
<h2>OUTPUT</h2>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 04-Apr-2007 18:33:36 UTC\r
+Last updated 07-Apr-2007 10:17:28 UTC\r
</div>\r
</div>\r
</body>\r
SYNOPSIS
--------
[verse]
-'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]
- [-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]
- [-m] [-M regex] [<CVS_module>]
+'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
+ [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
+ [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
+ [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
+ [<CVS_module>]
DESCRIPTION
OPTIONS
-------
+-v::
+ Verbosity: let 'cvsimport' report what it is doing.
+
-d <CVSROOT>::
The root of the CVS archive. May be local (a simple path) or remote;
currently, only the :local:, :ext: and :pserver: access methods
- are supported.
+ are supported. If not given, git-cvsimport will try to read it
+ from `CVS/Root`. If no such file exists, it checks for the
+ `CVSROOT` environment variable.
+
+<CVS_module>::
+ The CVS module you want to import. Relative to <CVSROOT>.
+ If not given, git-cvsimport tries to read it from
+ `CVS/Repository`.
-C <target-dir>::
The git repository to import to. If the directory doesn't
exist, it will be created. Default is the current directory.
+-o <branch-for-HEAD>::
+ The 'HEAD' branch from CVS is imported to the 'origin' branch within
+ the git repository, as 'HEAD' already has a special meaning for git.
+ Use this option if you want to import into a different branch.
++
+Use '-o master' for continuing an import that was initially done by
+the old cvs2git tool.
+
-i::
Import-only: don't perform a checkout after importing. This option
ensures the working directory and index remain untouched and will
not create them if they do not exist.
-k::
- Kill keywords: will extract files with -kk from the CVS archive
+ Kill keywords: will extract files with '-kk' from the CVS archive
to avoid noisy changesets. Highly recommended, but off by default
to preserve compatibility with early imported trees.
-u::
Convert underscores in tag and branch names to dots.
--o <branch-for-HEAD>::
- The 'HEAD' branch from CVS is imported to the 'origin' branch within
- the git repository, as 'HEAD' already has a special meaning for git.
- Use this option if you want to import into a different branch.
-+
-Use '-o master' for continuing an import that was initially done by
-the old cvs2git tool.
+-s <subst>::
+ Substitute the character "/" in branch names with <subst>
-p <options-for-cvsps>::
Additional options for cvsps.
+
If you need to pass multiple options, separate them with a comma.
+-z <fuzz>::
+ Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
+ cvsps defaults to 300s.
+
-P <cvsps-output-file>::
Instead of calling cvsps, read the provided cvsps output file. Useful
for debugging or when cvsps is being handled outside cvsimport.
-M <regex>::
Attempt to detect merges based on the commit message with a custom
- regex. It can be used with -m to also see the default regexes.
+ regex. It can be used with '-m' to also see the default regexes.
You must escape forward slashes.
--v::
- Verbosity: let 'cvsimport' report what it is doing.
-
-<CVS_module>::
- The CVS module you want to import. Relative to <CVSROOT>.
-
--h::
- Print a short usage message and exit.
-
--z <fuzz>::
- Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
- cvsps defaults to 300s.
-
--s <subst>::
- Substitute the character "/" in branch names with <subst>
+-S <regex>::
+ Skip paths matching the regex.
-a::
Import all commits, including recent ones. cvsimport by default
skips commits that have a timestamp less than 10 minutes ago.
--S <regex>::
- Skip paths matching the regex.
-
-L <limit>::
Limit the number of commits imported. Workaround for cases where
cvsimport leaks memory.
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
all along.
+
-For convenience, this data is saved to $GIT_DIR/cvs-authors
-each time the -A option is provided and read from that same
+For convenience, this data is saved to `$GIT_DIR/cvs-authors`
+each time the '-A' option is provided and read from that same
file each time git-cvsimport is run.
+
It is not recommended to use this feature if you intend to
export changes back to CVS again later with
gitlink:git-cvsexportcommit[1].
+-h::
+ Print a short usage message and exit.
+
OUTPUT
------
If '-v' is specified, the script reports what it is doing.
</div>\r
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
-<p><em>git-read-tree</em> (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] <tree-ish1> [<tree-ish2> [<tree-ish3>]])</p>\r
+<p><em>git-read-tree</em> (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]])</p>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
</p>\r
</dd>\r
<dt>\r
+--index-output=<file>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Instead of writing the results out to <tt>$GIT_INDEX_FILE</tt>,\r
+ write the resulting index in the named file. While the\r
+ command is operating, the original index file is locked\r
+ with the same mechanism as usual. The file must allow\r
+ to be rename(2)ed into from a temporary file that is\r
+ created next to the usual index file; typically this\r
+ means it needs to be on the same filesystem as the index\r
+ file itself, and you need write permission to the\r
+ directories the index file and index output file are\r
+ located in.\r
+</p>\r
+</dd>\r
+<dt>\r
<tree-ish#>\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 04-Apr-2007 18:33:58 UTC\r
+Last updated 07-Apr-2007 10:17:29 UTC\r
</div>\r
</div>\r
</body>\r
SYNOPSIS
--------
-'git-read-tree' (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
+'git-read-tree' (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
DESCRIPTION
file (usually '.gitignore') and allows such an untracked
but explicitly ignored file to be overwritten.
+--index-output=<file>::
+ Instead of writing the results out to `$GIT_INDEX_FILE`,
+ write the resulting index in the named file. While the
+ command is operating, the original index file is locked
+ with the same mechanism as usual. The file must allow
+ to be rename(2)ed into from a temporary file that is
+ created next to the usual index file; typically this
+ means it needs to be on the same filesystem as the index
+ file itself, and you need write permission to the
+ directories the index file and index output file are
+ located in.
+
<tree-ish#>::
The id of the tree object(s) to be read/merged.
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Git User's Manual</title><link rel="stylesheet" href="docbook-xsl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id232635"></a>Git User's Manual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#id264704">Preface</a></span></dt><dt><span class="chapter"><a href="#id233155">1. Git Quick Start</a></span></dt><dd><dl><dt><span class="section"><a href="#id233166">Creating a new repository</a></span></dt><dt><span class="section"><a href="#id233198">Managing branches</a></span></dt><dt><span class="section"><a href="#id232445">Exploring history</a></span></dt><dt><span class="section"><a href="#id232489">Making changes</a></span></dt><dt><span class="section"><a href="#id233361">Merging</a></span></dt><dt><span class="section"><a href="#id233378">Sharing your changes</a></span></dt><dt><span class="section"><a href="#id233463">Repository maintenance</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id232662">2. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#id232667">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232724">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273520">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273583">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273622">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273650">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id273673">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273806">Examining branches from a remote repository</a></span></dt><dt><span class="section"><a href="#how-git-stores-references">Naming branches, tags, and other references</a></span></dt><dt><span class="section"><a href="#Updating-a-repository-with-git-fetch">Updating a repository with git fetch</a></span></dt><dt><span class="section"><a href="#id274051">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id274125">3. Exploring git history</a></span></dt><dd><dl><dt><span class="section"><a href="#id274147">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#id274266">Naming commits</a></span></dt><dt><span class="section"><a href="#id274414">Creating tags</a></span></dt><dt><span class="section"><a href="#id274449">Browsing revisions</a></span></dt><dt><span class="section"><a href="#id274523">Generating diffs</a></span></dt><dt><span class="section"><a href="#id274566">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#id274592">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#id274598">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#id274650">Find first tagged version including a given fix</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id274814">4. Developing with git</a></span></dt><dd><dl><dt><span class="section"><a href="#id274820">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274852">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">how to make a commit</a></span></dt><dt><span class="section"><a href="#id275079">creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275095">how to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#id275232">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">undoing a merge</a></span></dt><dt><span class="section"><a href="#id275441">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275469">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275522">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-editing-history">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275655">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275713">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275751">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275756">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275831">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id275981">5. Sharing development with others</a></span></dt><dd><dl><dt><span class="section"><a href="#getting-updates-with-git-pull">Getting updates with git pull</a></span></dt><dt><span class="section"><a href="#id276113">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#id276162">Importing patches to a project</a></span></dt><dt><span class="section"><a href="#setting-up-a-public-repository">Setting up a public repository</a></span></dt><dt><span class="section"><a href="#exporting-via-http">Exporting a git repository via http</a></span></dt><dt><span class="section"><a href="#exporting-via-git">Exporting a git repository via the git protocol</a></span></dt><dt><span class="section"><a href="#pushing-changes-to-a-public-repository">Pushing changes to a public repository</a></span></dt><dt><span class="section"><a href="#id276575">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#id276594">Allow web browsing of a repository</a></span></dt><dt><span class="section"><a href="#id276607">Examples</a></span></dt></dl></dd><dt><span class="chapter"><a href="#cleaning-up-history">6. Rewriting history and maintaining patch series</a></span></dt><dd><dl><dt><span class="section"><a href="#id276638">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#id276713">Keeping a patch series up to date using git-rebase</a></span></dt><dt><span class="section"><a href="#id276844">Modifying a single commit</a></span></dt><dt><span class="section"><a href="#id276934">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#id276994">Other tools</a></span></dt><dt><span class="section"><a href="#id277007">Problems with rewriting history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id277078">7. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#id277084">Fetching individual branches</a></span></dt><dt><span class="section"><a href="#fast-forwards">Understanding git history: fast-forwards</a></span></dt><dt><span class="section"><a href="#id277204">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#id277231">Configuring remote branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#git-internals">8. Git internals</a></span></dt><dd><dl><dt><span class="section"><a href="#id277369">The Object Database</a></span></dt><dt><span class="section"><a href="#id277485">Blob Object</a></span></dt><dt><span class="section"><a href="#id277528">Tree Object</a></span></dt><dt><span class="section"><a href="#id232240">Commit Object</a></span></dt><dt><span class="section"><a href="#id277720">Trust</a></span></dt><dt><span class="section"><a href="#id277771">Tag Object</a></span></dt><dt><span class="section"><a href="#id277817">The "index" aka "Current Directory Cache"</a></span></dt><dt><span class="section"><a href="#id277893">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#id277911">working directory -> index</a></span></dt><dt><span class="section"><a href="#id278001">index -> object database</a></span></dt><dt><span class="section"><a href="#id278029">object database -> index</a></span></dt><dt><span class="section"><a href="#id278060">index -> working directory</a></span></dt><dt><span class="section"><a href="#id278124">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#id278218">Examining the data</a></span></dt><dt><span class="section"><a href="#id278296">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#id278384">Merging multiple trees, continued</a></span></dt><dt><span class="section"><a href="#id278644">How git stores objects efficiently: pack files</a></span></dt><dt><span class="section"><a href="#dangling-objects">Dangling objects</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id278904">9. GIT Glossary</a></span></dt><dt><span class="chapter"><a href="#id282186">10. Notes and todo list for this manual</a></span></dt></dl></div><div class="preface" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id264704"></a>Preface</h2></div></div></div><p>This manual is designed to be readable by someone with basic unix
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Git User's Manual</title><link rel="stylesheet" href="docbook-xsl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id232635"></a>Git User's Manual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#id264704">Preface</a></span></dt><dt><span class="chapter"><a href="#id233155">1. Git Quick Start</a></span></dt><dd><dl><dt><span class="section"><a href="#id233166">Creating a new repository</a></span></dt><dt><span class="section"><a href="#id233198">Managing branches</a></span></dt><dt><span class="section"><a href="#id232445">Exploring history</a></span></dt><dt><span class="section"><a href="#id232489">Making changes</a></span></dt><dt><span class="section"><a href="#id233361">Merging</a></span></dt><dt><span class="section"><a href="#id233378">Sharing your changes</a></span></dt><dt><span class="section"><a href="#id233463">Repository maintenance</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id232662">2. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#id232667">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232724">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273520">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273583">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273622">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273650">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id273673">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273806">Examining branches from a remote repository</a></span></dt><dt><span class="section"><a href="#how-git-stores-references">Naming branches, tags, and other references</a></span></dt><dt><span class="section"><a href="#Updating-a-repository-with-git-fetch">Updating a repository with git fetch</a></span></dt><dt><span class="section"><a href="#id274051">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id274125">3. Exploring git history</a></span></dt><dd><dl><dt><span class="section"><a href="#id274147">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#id274266">Naming commits</a></span></dt><dt><span class="section"><a href="#id274414">Creating tags</a></span></dt><dt><span class="section"><a href="#id274449">Browsing revisions</a></span></dt><dt><span class="section"><a href="#id274523">Generating diffs</a></span></dt><dt><span class="section"><a href="#id274566">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#id274592">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#id274598">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#id274650">Find first tagged version including a given fix</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id274814">4. Developing with git</a></span></dt><dd><dl><dt><span class="section"><a href="#id274820">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274852">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">How to make a commit</a></span></dt><dt><span class="section"><a href="#id275079">Creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275095">How to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#id275232">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">Undoing a merge</a></span></dt><dt><span class="section"><a href="#id275441">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275469">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275522">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-editing-history">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275655">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275713">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275751">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275756">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275831">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id275981">5. Sharing development with others</a></span></dt><dd><dl><dt><span class="section"><a href="#getting-updates-with-git-pull">Getting updates with git pull</a></span></dt><dt><span class="section"><a href="#id276113">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#id276162">Importing patches to a project</a></span></dt><dt><span class="section"><a href="#setting-up-a-public-repository">Setting up a public repository</a></span></dt><dt><span class="section"><a href="#exporting-via-http">Exporting a git repository via http</a></span></dt><dt><span class="section"><a href="#exporting-via-git">Exporting a git repository via the git protocol</a></span></dt><dt><span class="section"><a href="#pushing-changes-to-a-public-repository">Pushing changes to a public repository</a></span></dt><dt><span class="section"><a href="#id276575">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#id276594">Allow web browsing of a repository</a></span></dt><dt><span class="section"><a href="#id276607">Examples</a></span></dt></dl></dd><dt><span class="chapter"><a href="#cleaning-up-history">6. Rewriting history and maintaining patch series</a></span></dt><dd><dl><dt><span class="section"><a href="#id276638">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#id276713">Keeping a patch series up to date using git-rebase</a></span></dt><dt><span class="section"><a href="#id276844">Modifying a single commit</a></span></dt><dt><span class="section"><a href="#id276934">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#id276994">Other tools</a></span></dt><dt><span class="section"><a href="#id277007">Problems with rewriting history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id277078">7. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#id277084">Fetching individual branches</a></span></dt><dt><span class="section"><a href="#fast-forwards">Understanding git history: fast-forwards</a></span></dt><dt><span class="section"><a href="#id277204">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#id277231">Configuring remote branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#git-internals">8. Git internals</a></span></dt><dd><dl><dt><span class="section"><a href="#id277369">The Object Database</a></span></dt><dt><span class="section"><a href="#id277485">Blob Object</a></span></dt><dt><span class="section"><a href="#id277528">Tree Object</a></span></dt><dt><span class="section"><a href="#id232240">Commit Object</a></span></dt><dt><span class="section"><a href="#id277720">Trust</a></span></dt><dt><span class="section"><a href="#id277771">Tag Object</a></span></dt><dt><span class="section"><a href="#id277817">The "index" aka "Current Directory Cache"</a></span></dt><dt><span class="section"><a href="#id277893">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#id277911">working directory -> index</a></span></dt><dt><span class="section"><a href="#id278001">index -> object database</a></span></dt><dt><span class="section"><a href="#id278029">object database -> index</a></span></dt><dt><span class="section"><a href="#id278060">index -> working directory</a></span></dt><dt><span class="section"><a href="#id278124">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#id278218">Examining the data</a></span></dt><dt><span class="section"><a href="#id278296">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#id278384">Merging multiple trees, continued</a></span></dt><dt><span class="section"><a href="#id278644">How git stores objects efficiently: pack files</a></span></dt><dt><span class="section"><a href="#dangling-objects">Dangling objects</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id278904">9. GIT Glossary</a></span></dt><dt><span class="chapter"><a href="#id282186">10. Notes and todo list for this manual</a></span></dt></dl></div><div class="preface" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id264704"></a>Preface</h2></div></div></div><p>This manual is designed to be readable by someone with basic unix
command-line skills, but no previous knowledge of git.</p><p>Chapter 1 gives a brief overview of git commands, without any
explanation; you may prefer to skip to chapter 2 on a first reading.</p><p>Chapters 2 and 3 explain how to fetch and study a project using
git—the tools you'd need to build and test a particular version of a
! [v1.5.0-rc2] GIT v1.5.0-rc2<br>
...</p></div><p>then search for a line that looks like</p><div class="literallayout"><p>+ ++ [e05db0fd] Fix warnings in sha1_file.c - use C99 printf format if<br>
available</p></div><p>Which shows that e05db0fd is reachable from itself, from v1.5.0-rc1, and
-from v1.5.0-rc2, but not from v1.5.0-rc0.</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id274814"></a>Chapter 4. Developing with git</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id274820">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274852">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">how to make a commit</a></span></dt><dt><span class="section"><a href="#id275079">creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275095">how to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#id275232">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">undoing a merge</a></span></dt><dt><span class="section"><a href="#id275441">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275469">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275522">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-editing-history">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275655">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275713">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275751">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275756">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275831">Recovering lost changes</a></span></dt></dl></dd></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id274820"></a>Telling git your name</h2></div></div></div><p>Before creating any commits, you should introduce yourself to git. The
+from v1.5.0-rc2, but not from v1.5.0-rc0.</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id274814"></a>Chapter 4. Developing with git</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id274820">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274852">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">How to make a commit</a></span></dt><dt><span class="section"><a href="#id275079">Creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275095">How to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#id275232">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">Undoing a merge</a></span></dt><dt><span class="section"><a href="#id275441">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275469">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275522">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-editing-history">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275655">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275713">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275751">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275756">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275831">Recovering lost changes</a></span></dt></dl></dd></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id274820"></a>Telling git your name</h2></div></div></div><p>Before creating any commits, you should introduce yourself to git. The
easiest way to do so is:</p><div class="literallayout"><p>$ cat >~/.gitconfig <<\EOF<br>
[user]<br>
name = Your Name Comes Here<br>
$ cd project<br>
$ git init<br>
$ git add . # include everything below ./ in the first commit:<br>
-$ git commit</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="how-to-make-a-commit"></a>how to make a commit</h2></div></div></div><p>Creating a new commit takes three steps:</p><div class="orderedlist"><ol type="1"><li>
+$ git commit</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="how-to-make-a-commit"></a>How to make a commit</h2></div></div></div><p>Creating a new commit takes three steps:</p><div class="orderedlist"><ol type="1"><li>
Making some changes to the working directory using your
favorite editor.
</li><li>
$ git diff # difference between the index file and your<br>
# working directory; changes that would not<br>
# be included if you ran "commit" now.<br>
-$ git status # a brief per-file summary of the above.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id275079"></a>creating good commit messages</h2></div></div></div><p>Though not required, it's a good idea to begin the commit message
+$ git status # a brief per-file summary of the above.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id275079"></a>Creating good commit messages</h2></div></div></div><p>Though not required, it's a good idea to begin the commit message
with a single short (less than 50 character) line summarizing the
change, followed by a blank line and then a more thorough
description. Tools that turn commits into email, for example, use
the first line on the Subject line and the rest of the commit in the
-body.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id275095"></a>how to merge</h2></div></div></div><p>You can rejoin two diverging branches of development using
+body.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id275095"></a>How to merge</h2></div></div></div><p>You can rejoin two diverging branches of development using
<a href="git-merge.html" target="_top">git-merge(1)</a>:</p><div class="literallayout"><p>$ git merge branchname</p></div><p>merges the development in the branch "branchname" into the current
branch. If there are conflicts—for example, if the same file is
modified in two different ways in the remote branch and the local
for merges:</p><div class="literallayout"><p>$ git log --merge<br>
$ gitk --merge</p></div><p>These will display all commits which exist only on HEAD or on
MERGE_HEAD, and which touch an unmerged file.</p><p>Each time you resolve the conflicts in a file and update the index:</p><div class="literallayout"><p>$ git add file.txt</p></div><p>the different stages of that file will be "collapsed", after which
-git-diff will (by default) no longer show diffs for that file.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="undoing-a-merge"></a>undoing a merge</h2></div></div></div><p>If you get stuck and decide to just give up and throw the whole mess
+git-diff will (by default) no longer show diffs for that file.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="undoing-a-merge"></a>Undoing a merge</h2></div></div></div><p>If you get stuck and decide to just give up and throw the whole mess
away, you can always return to the pre-merge state with</p><div class="literallayout"><p>$ git reset --hard HEAD</p></div><p>Or, if you've already commited the merge that you want to throw away,</p><div class="literallayout"><p>$ git reset --hard ORIG_HEAD</p></div><p>However, this last command can be dangerous in some cases—never
throw away a commit you have already committed if that commit may
itself have been merged into another branch, as doing so may confuse
with the changes to be reverted, then you will be asked to fix
conflicts manually, just as in the case of <a href="#resolving-a-merge" title="Resolving a merge">resolving a merge</a>.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="fixing-a-mistake-by-editing-history"></a>Fixing a mistake by editing history</h3></div></div></div><p>If the problematic commit is the most recent commit, and you have not
yet made that commit public, then you may just
-<a href="#undoing-a-merge" title="undoing a merge">destroy it using git-reset</a>.</p><p>Alternatively, you
+<a href="#undoing-a-merge" title="Undoing a merge">destroy it using git-reset</a>.</p><p>Alternatively, you
can edit the working directory and update the index to fix your
-mistake, just as if you were going to <a href="#how-to-make-a-commit" title="how to make a commit">create a new commit</a>, then run</p><div class="literallayout"><p>$ git commit --amend</p></div><p>which will replace the old commit by a new commit incorporating your
+mistake, just as if you were going to <a href="#how-to-make-a-commit" title="How to make a commit">create a new commit</a>, then run</p><div class="literallayout"><p>$ git commit --amend</p></div><p>which will replace the old commit by a new commit incorporating your
changes, giving you a chance to edit the old commit message first.</p><p>Again, you should never do this to a commit that may already have
been merged into another branch; use <a href="git-revert.html" target="_top">git-revert(1)</a> instead in
that case.</p><p>It is also possible to edit commits further back in the history, but
-------------------------------------------------
[[how-to-make-a-commit]]
-how to make a commit
+How to make a commit
--------------------
Creating a new commit takes three steps:
$ git status # a brief per-file summary of the above.
-------------------------------------------------
-creating good commit messages
+Creating good commit messages
-----------------------------
Though not required, it's a good idea to begin the commit message
the first line on the Subject line and the rest of the commit in the
body.
-how to merge
+How to merge
------------
You can rejoin two diverging branches of development using
git-diff will (by default) no longer show diffs for that file.
[[undoing-a-merge]]
-undoing a merge
+Undoing a merge
---------------
If you get stuck and decide to just give up and throw the whole mess