Duplicate another git repository on a local system.
gitlink:git-send-pack[1]::
- Push objects over git protocol to another reposiotory.
+ Push objects over git protocol to another repository.
gitlink:git-ssh-fetch[1]::
Fetch from a remote repository over ssh connection.
Subsection names can contain any characters except newline (doublequote
'`"`' and backslash have to be escaped as '`\"`' and '`\\`',
-respecitvely) and are case sensitive. Section header cannot span multiple
+respectively) and are case sensitive. Section header cannot span multiple
lines. Variables may belong directly to a section or to a given subsection.
You can have `[section]` if you have `[section "subsection"]`, but you
don't need to.
deleted file mode <mode>,<mode>
+
The `mode <mode>,<mode>..<mode>` line appears only if at least one of
-the <mode> is diferent from the rest. Extended headers with
+the <mode> is different from the rest. Extended headers with
information about detected contents movement (renames and
copying detection) are designed to work with diff of two
<tree-ish> and are not used by combined diff format.
</div></div>\r
<p>Subsection names can contain any characters except newline (doublequote\r
<em><tt>"</tt></em> and backslash have to be escaped as <em><tt>\"</tt></em> and <em><tt>\\</tt></em>,\r
-respecitvely) and are case sensitive. Section header cannot span multiple\r
+respectively) and are case sensitive. Section header cannot span multiple\r
lines. Variables may belong directly to a section or to a given subsection.\r
You can have <tt>[section]</tt> if you have <tt>[section "subsection"]</tt>, but you\r
don't need to.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 29-Jan-2007 02:55:06 UTC\r
+Last updated 04-Feb-2007 08:31:39 UTC\r
</div>\r
</div>\r
</body>\r
deleted file mode <mode>,<mode></tt></pre>\r
</div></div>\r
<p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of\r
-the <mode> is diferent from the rest. Extended headers with\r
+the <mode> is different from the rest. Extended headers with\r
information about detected contents movement (renames and\r
copying detection) are designed to work with diff of two\r
<tree-ish> and are not used by combined diff format.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 28-Jan-2007 10:29:05 UTC\r
+Last updated 04-Feb-2007 08:31:41 UTC\r
</div>\r
</div>\r
</body>\r
deleted file mode <mode>,<mode></tt></pre>\r
</div></div>\r
<p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of\r
-the <mode> is diferent from the rest. Extended headers with\r
+the <mode> is different from the rest. Extended headers with\r
information about detected contents movement (renames and\r
copying detection) are designed to work with diff of two\r
<tree-ish> and are not used by combined diff format.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 28-Jan-2007 10:29:06 UTC\r
+Last updated 04-Feb-2007 08:31:42 UTC\r
</div>\r
</div>\r
</body>\r
deleted file mode <mode>,<mode></tt></pre>\r
</div></div>\r
<p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of\r
-the <mode> is diferent from the rest. Extended headers with\r
+the <mode> is different from the rest. Extended headers with\r
information about detected contents movement (renames and\r
copying detection) are designed to work with diff of two\r
<tree-ish> and are not used by combined diff format.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 28-Jan-2007 10:29:07 UTC\r
+Last updated 04-Feb-2007 08:31:43 UTC\r
</div>\r
</div>\r
</body>\r
deleted file mode <mode>,<mode></tt></pre>\r
</div></div>\r
<p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of\r
-the <mode> is diferent from the rest. Extended headers with\r
+the <mode> is different from the rest. Extended headers with\r
information about detected contents movement (renames and\r
copying detection) are designed to work with diff of two\r
<tree-ish> and are not used by combined diff format.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 28-Jan-2007 10:29:07 UTC\r
+Last updated 04-Feb-2007 08:31:43 UTC\r
</div>\r
</div>\r
</body>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
<p>Manage the set of repositories ("remotes") whose branches you track.</p>\r
-<p>With no arguments, shows a list of existing remotes.</p>\r
-<p>In the second form, adds a remote named <name> for the repository at\r
+</div>\r
+<h2>COMMANDS</h2>\r
+<div class="sectionbody">\r
+<p>With no arguments, shows a list of existing remotes. Several\r
+subcommands are available to perform operations on the remotes.</p>\r
+<dl>\r
+<dt>\r
+<em>add</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+Adds a remote named <name> for the repository at\r
<url>. The command <tt>git fetch <name></tt> can then be used to create and\r
-update remote-tracking branches <name>/<branch>.</p>\r
-<p>In the third form, gives some information about the remote <name>.</p>\r
-<p>In the fourth form, deletes all stale tracking branches under <name>.\r
+update remote-tracking branches <name>/<branch>.\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>show</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+Gives some information about the remote <name>.\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>prune</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+Deletes all stale tracking branches under <name>.\r
These stale branches have already been removed from the remote repository\r
-referenced by <name>, but are still locally available in "remotes/<name>".</p>\r
+referenced by <name>, but are still locally available in "remotes/<name>".\r
+</p>\r
+</dd>\r
+</dl>\r
+</div>\r
+<h2>DISCUSSION</h2>\r
+<div class="sectionbody">\r
<p>The remote configuration is achieved using the <tt>remote.origin.url</tt> and\r
<tt>remote.origin.fetch</tt> configuration variables. (See\r
<a href="git-config.html">git-config(1)</a>).</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Feb-2007 07:34:52 UTC\r
+Last updated 04-Feb-2007 08:31:45 UTC\r
</div>\r
</div>\r
</body>\r
Manage the set of repositories ("remotes") whose branches you track.
-With no arguments, shows a list of existing remotes.
-In the second form, adds a remote named <name> for the repository at
+COMMANDS
+--------
+
+With no arguments, shows a list of existing remotes. Several
+subcommands are available to perform operations on the remotes.
+
+'add'::
+
+Adds a remote named <name> for the repository at
<url>. The command `git fetch <name>` can then be used to create and
update remote-tracking branches <name>/<branch>.
-In the third form, gives some information about the remote <name>.
+'show'::
-In the fourth form, deletes all stale tracking branches under <name>.
+Gives some information about the remote <name>.
+
+'prune'::
+
+Deletes all stale tracking branches under <name>.
These stale branches have already been removed from the remote repository
referenced by <name>, but are still locally available in "remotes/<name>".
+
+DISCUSSION
+----------
+
The remote configuration is achieved using the `remote.origin.url` and
`remote.origin.fetch` configuration variables. (See
gitlink:git-config[1]).
<h2>NAME</h2>\r
<div class="sectionbody">\r
<p>git-send-pack -\r
- Push objects over git protocol to another reposiotory\r
+ Push objects over git protocol to another repository\r
</p>\r
</div>\r
</div>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 20-Jan-2007 02:22:40 UTC\r
+Last updated 04-Feb-2007 08:31:45 UTC\r
</div>\r
</div>\r
</body>\r
NAME
----
-git-send-pack - Push objects over git protocol to another reposiotory
+git-send-pack - Push objects over git protocol to another repository
SYNOPSIS
<dd>\r
<p>\r
This command supports git-svnimport-like command-line syntax for\r
- importing repositories that are layed out as recommended by the\r
+ importing repositories that are laid out as recommended by the\r
SVN folks. This is a bit more tolerant than the git-svnimport\r
command-line syntax and doesn't require the user to figure out\r
where the repository URL ends and where the repository path\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 29-Jan-2007 02:55:11 UTC\r
+Last updated 04-Feb-2007 08:31:45 UTC\r
</div>\r
</div>\r
</body>\r
'multi-init'::
This command supports git-svnimport-like command-line syntax for
- importing repositories that are layed out as recommended by the
+ importing repositories that are laid out as recommended by the
SVN folks. This is a bit more tolerant than the git-svnimport
command-line syntax and doesn't require the user to figure out
where the repository URL ends and where the repository path
</dt>\r
<dd>\r
<p>\r
- Push objects over git protocol to another reposiotory.\r
+ Push objects over git protocol to another repository.\r
</p>\r
</dd>\r
<dt>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Feb-2007 07:34:53 UTC\r
+Last updated 04-Feb-2007 08:31:47 UTC\r
</div>\r
</div>\r
</body>\r
<p>\r
Limit commits to the ones touching files in the given paths. Note, to\r
avoid ambiguity wrt. revision names use "--" to separate the paths\r
- from any preceeding options.\r
+ from any preceding options.\r
</p>\r
</dd>\r
</dl>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 19-Jan-2007 00:37:39 UTC\r
+Last updated 04-Feb-2007 08:31:46 UTC\r
</div>\r
</div>\r
</body>\r
Limit commits to the ones touching files in the given paths. Note, to
avoid ambiguity wrt. revision names use "--" to separate the paths
- from any preceeding options.
+ from any preceding options.
Examples
--------
<p>Be careful with that last command: in addition to losing any changes\r
in the working directory, it will also remove all later commits from\r
this branch. If this branch is the only branch containing those\r
-commits, they will be lost. (Also, don't use "git reset" on a\r
-publicly-visible branch that other developers pull from, as git will\r
-be confused by history that disappears in this way.)</p>\r
+commits, they will be lost. Also, don't use "git reset" on a\r
+publicly-visible branch that other developers pull from, as it will\r
+force needless merges on other developers to clean up the history.</p>\r
<p>The git grep command can search for strings in any version of your\r
project, so</p>\r
<div class="listingblock">\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Feb-2007 08:07:23 UTC\r
+Last updated 04-Feb-2007 08:31:49 UTC\r
</div>\r
</div>\r
</body>\r
Be careful with that last command: in addition to losing any changes
in the working directory, it will also remove all later commits from
this branch. If this branch is the only branch containing those
-commits, they will be lost. (Also, don't use "git reset" on a
-publicly-visible branch that other developers pull from, as git will
-be confused by history that disappears in this way.)
+commits, they will be lost. Also, don't use "git reset" on a
+publicly-visible branch that other developers pull from, as it will
+force needless merges on other developers to clean up the history.
The git grep command can search for strings in any version of your
project, so
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Git User's Manual</title><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="id232381"></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="#id264754">Preface</a></span></dt><dt><span class="chapter"><a href="#id233103">1. Git Quick Start</a></span></dt><dd><dl><dt><span class="section"><a href="#id233114">Creating a new repository</a></span></dt><dt><span class="section"><a href="#id233145">Managing branches</a></span></dt><dt><span class="section"><a href="#id232598">Exploring history</a></span></dt><dt><span class="section"><a href="#id232642">Making changes</a></span></dt><dt><span class="section"><a href="#id233404">Merging</a></span></dt><dt><span class="section"><a href="#id233420">Sharing your changes</a></span></dt><dt><span class="section"><a href="#id233504">Repository maintenance</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id232726">2. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#id232732">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232788">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273450">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273500">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273540">Undestanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273568">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id232302">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273792">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="#id274036">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id274111">3. Exploring git history</a></span></dt><dd><dl><dt><span class="section"><a href="#id274133">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#id274253">Naming commits</a></span></dt><dt><span class="section"><a href="#id274503">Creating tags</a></span></dt><dt><span class="section"><a href="#id274539">Browsing revisions</a></span></dt><dt><span class="section"><a href="#id274612">Generating diffs</a></span></dt><dt><span class="section"><a href="#id274655">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#id274682">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#id274687">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#id274740">Find first tagged version including a given fix</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id274904">4. Developing with git</a></span></dt><dd><dl><dt><span class="section"><a href="#id274909">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274941">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="#id275168">creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275184">how to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dt><span class="section"><a href="#undoing-a-merge">undoing a merge</a></span></dt><dt><span class="section"><a href="#id275420">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275449">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275502">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#id275560">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275631">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275689">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275727">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275732">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275807">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id275957">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="#id276089">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#id276138">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="#id276550">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#id276569">Allow web browsing of a repository</a></span></dt><dt><span class="section"><a href="#id276582">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="#id276613">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#id276688">Keeping a patch series up to date using git-rebase</a></span></dt><dt><span class="section"><a href="#id276825">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#id276885">Other tools</a></span></dt><dt><span class="section"><a href="#id276897">Problems with rewriting history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id276969">7. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#id276975">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="#id277095">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#id277122">Configuring remote branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id277246">8. Git internals</a></span></dt><dd><dl><dt><span class="section"><a href="#id277257">The Object Database</a></span></dt><dt><span class="section"><a href="#id277373">Blob Object</a></span></dt><dt><span class="section"><a href="#id277416">Tree Object</a></span></dt><dt><span class="section"><a href="#id277494">Commit Object</a></span></dt><dt><span class="section"><a href="#id277540">Trust</a></span></dt><dt><span class="section"><a href="#id277591">Tag Object</a></span></dt><dt><span class="section"><a href="#id277637">The "index" aka "Current Directory Cache"</a></span></dt><dt><span class="section"><a href="#id277712">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#id277731">working directory -> index</a></span></dt><dt><span class="section"><a href="#id277820">index -> object database</a></span></dt><dt><span class="section"><a href="#id277849">object database -> index</a></span></dt><dt><span class="section"><a href="#id277880">index -> working directory</a></span></dt><dt><span class="section"><a href="#id277943">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#id278038">Examining the data</a></span></dt><dt><span class="section"><a href="#id278116">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#id278203">Merging multiple trees, continued</a></span></dt><dt><span class="section"><a href="#id278463">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="#id278723">9. Glossary of git terms</a></span></dt><dt><span class="chapter"><a href="#id279939">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="id264754"></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><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="id232381"></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="#id264754">Preface</a></span></dt><dt><span class="chapter"><a href="#id233103">1. Git Quick Start</a></span></dt><dd><dl><dt><span class="section"><a href="#id233114">Creating a new repository</a></span></dt><dt><span class="section"><a href="#id233145">Managing branches</a></span></dt><dt><span class="section"><a href="#id232598">Exploring history</a></span></dt><dt><span class="section"><a href="#id232642">Making changes</a></span></dt><dt><span class="section"><a href="#id233404">Merging</a></span></dt><dt><span class="section"><a href="#id233420">Sharing your changes</a></span></dt><dt><span class="section"><a href="#id233504">Repository maintenance</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id232726">2. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#id232732">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232788">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273450">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273500">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273540">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273568">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id232302">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273792">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="#id274036">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id274111">3. Exploring git history</a></span></dt><dd><dl><dt><span class="section"><a href="#id274133">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#id274253">Naming commits</a></span></dt><dt><span class="section"><a href="#id274503">Creating tags</a></span></dt><dt><span class="section"><a href="#id274539">Browsing revisions</a></span></dt><dt><span class="section"><a href="#id274612">Generating diffs</a></span></dt><dt><span class="section"><a href="#id274655">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#id274682">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#id274687">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#id274740">Find first tagged version including a given fix</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id274904">4. Developing with git</a></span></dt><dd><dl><dt><span class="section"><a href="#id274909">Telling git your name</a></span></dt><dt><span class="section"><a href="#id274941">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="#id275168">creating good commit messages</a></span></dt><dt><span class="section"><a href="#id275184">how to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dt><span class="section"><a href="#undoing-a-merge">undoing a merge</a></span></dt><dt><span class="section"><a href="#id275420">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#id275449">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#id275502">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#id275560">Fixing a mistake by editing history</a></span></dt><dt><span class="section"><a href="#id275631">Checking out an old version of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#id275689">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#id275727">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#id275732">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#id275807">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id275957">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="#id276089">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#id276138">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="#id276550">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#id276569">Allow web browsing of a repository</a></span></dt><dt><span class="section"><a href="#id276582">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="#id276613">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#id276688">Keeping a patch series up to date using git-rebase</a></span></dt><dt><span class="section"><a href="#id276825">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#id276885">Other tools</a></span></dt><dt><span class="section"><a href="#id276897">Problems with rewriting history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id276969">7. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#id276975">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="#id277095">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#id277122">Configuring remote branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id277246">8. Git internals</a></span></dt><dd><dl><dt><span class="section"><a href="#id277257">The Object Database</a></span></dt><dt><span class="section"><a href="#id277373">Blob Object</a></span></dt><dt><span class="section"><a href="#id277416">Tree Object</a></span></dt><dt><span class="section"><a href="#id277494">Commit Object</a></span></dt><dt><span class="section"><a href="#id277540">Trust</a></span></dt><dt><span class="section"><a href="#id277591">Tag Object</a></span></dt><dt><span class="section"><a href="#id277637">The "index" aka "Current Directory Cache"</a></span></dt><dt><span class="section"><a href="#id277712">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#id277731">working directory -> index</a></span></dt><dt><span class="section"><a href="#id277820">index -> object database</a></span></dt><dt><span class="section"><a href="#id277849">object database -> index</a></span></dt><dt><span class="section"><a href="#id277880">index -> working directory</a></span></dt><dt><span class="section"><a href="#id277943">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#id278038">Examining the data</a></span></dt><dt><span class="section"><a href="#id278116">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#id278203">Merging multiple trees, continued</a></span></dt><dt><span class="section"><a href="#id278463">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="#id278723">9. Glossary of git terms</a></span></dt><dt><span class="chapter"><a href="#id279939">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="id264754"></a>Preface</h2></div></div></div><p>This manual is designed to be readable by someone with basic unix
commandline 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
current branch:</p><div class="literallayout"><p>$ git pull git://example.com/project.git theirbranch</p></div><p>Store the fetched branch into a local branch before merging into the
current branch:</p><div class="literallayout"><p>$ git pull git://example.com/project.git theirbranch:mybranch</p></div><p>After creating commits on a local branch, update the remote
branch with your commits:</p><div class="literallayout"><p>$ git push ssh://example.com/project.git mybranch:theirbranch</p></div><p>When remote and local branch are both named "test":</p><div class="literallayout"><p>$ git push ssh://example.com/project.git test</p></div><p>Shortcut version for a frequently used remote repository:</p><div class="literallayout"><p>$ git remote add example ssh://example.com/project.git<br>
-$ git push example test</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id233504"></a>Repository maintenance</h2></div></div></div><p>Check for corruption:</p><div class="literallayout"><p>$ git fsck</p></div><p>Recompress, remove unused cruft:</p><div class="literallayout"><p>$ git gc</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id232726"></a>Chapter 2. Repositories and Branches</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id232732">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232788">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273450">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273500">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273540">Undestanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273568">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id232302">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273792">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="#id274036">Fetching branches from other repositories</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id232732"></a>How to get a git repository</h2></div></div></div><p>It will be useful to have a git repository to experiment with as you
+$ git push example test</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id233504"></a>Repository maintenance</h2></div></div></div><p>Check for corruption:</p><div class="literallayout"><p>$ git fsck</p></div><p>Recompress, remove unused cruft:</p><div class="literallayout"><p>$ git gc</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id232726"></a>Chapter 2. Repositories and Branches</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id232732">How to get a git repository</a></span></dt><dt><span class="section"><a href="#id232788">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#id273450">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#id273500">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#id273540">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#id273568">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#id232302">Manipulating branches</a></span></dt><dt><span class="section"><a href="#id273792">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="#id274036">Fetching branches from other repositories</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id232732"></a>How to get a git repository</h2></div></div></div><p>It will be useful to have a git repository to experiment with as you
read this manual.</p><p>The best way to get one is by using the <a href="git-clone.html" target="_top">git-clone(1)</a> command
to download a copy of an existing repository for a project that you
are interested in. If you don't already have a project in mind, here
commits will help understand how the git organizes history.</p><p>In the following, we say that commit X is "reachable" from commit Y
if commit X is an ancestor of commit Y. Equivalently, you could say
that Y is a descendent of X, or that there is a chain of parents
-leading from commit Y to commit X.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id273540"></a>Undestanding history: History diagrams</h3></div></div></div><p>We will sometimes represent git history using diagrams like the one
+leading from commit Y to commit X.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id273540"></a>Understanding history: History diagrams</h3></div></div></div><p>We will sometimes represent git history using diagrams like the one
below. Commits are shown as "o", and the links between them with
lines drawn with - / and \. Time goes left to right:</p><pre class="literallayout"> o--o--o <-- Branch A
/
commits since v2.5 which touch the Makefile or any file under fs:</p><div class="literallayout"><p>$ git log v2.5.. Makefile fs/</p></div><p>You can also ask git log to show patches:</p><div class="literallayout"><p>$ git log -p</p></div><p>See the "—pretty" option in the <a href="git-log.html" target="_top">git-log(1)</a> man page for more
display options.</p><p>Note that git log starts with the most recent commit and works
backwards through the parents; however, since git history can contain
-multiple independant lines of development, the particular order that
+multiple independent lines of development, the particular order that
commits are listed in may be somewhat arbitrary.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id274612"></a>Generating diffs</h2></div></div></div><p>You can generate diffs between any two versions using
<a href="git-diff.html" target="_top">git-diff(1)</a>:</p><div class="literallayout"><p>$ git diff master..test</p></div><p>Sometimes what you want instead is a set of patches:</p><div class="literallayout"><p>$ git format-patch master..test</p></div><p>will generate a file with a patch for each commit reachable from test
but not from master. Note that if master also has commits which are
is what you'd commit if you created the commit now—and that</p><div class="literallayout"><p>$ git diff</p></div><p>shows the difference between the working tree and the index file.</p><p>Note that "git add" always adds just the current contents of a file
to the index; further changes to the same file will be ignored unless
you run git-add on the file again.</p><p>When you're ready, just run</p><div class="literallayout"><p>$ git commit</p></div><p>and git will prompt you for a commit message and then create the new
-commmit. Check to make sure it looks like what you expected with</p><div class="literallayout"><p>$ git show</p></div><p>As a special shortcut,</p><div class="literallayout"><p>$ git commit -a</p></div><p>will update the index with any files that you've modified or removed
+commit. Check to make sure it looks like what you expected with</p><div class="literallayout"><p>$ git show</p></div><p>As a special shortcut,</p><div class="literallayout"><p>$ git commit -a</p></div><p>will update the index with any files that you've modified or removed
and create a commit, all in one step.</p><p>A number of commands are useful for keeping track of what you're
about to commit:</p><div class="literallayout"><p>$ git diff --cached # difference between HEAD and the index; what<br>
# would be commited if you ran "commit" now.<br>
actually. And note gitk —merge.</p><p>Add more good examples. Entire sections of just cookbook examples
might be a good idea; maybe make an "advanced examples" section a
standard end-of-chapter section?</p><p>Include cross-references to the glossary, where appropriate.</p><p>Document shallow clones? See draft 1.5.0 release notes for some
-documentation.</p><p>Add a sectin on working with other version control systems, including
+documentation.</p><p>Add a section on working with other version control systems, including
CVS, Subversion, and just imports of series of release tarballs.</p><p>More details on gitweb?</p><p>Write a chapter on using plumbing and writing scripts.</p></div></div></body></html>
that Y is a descendent of X, or that there is a chain of parents
leading from commit Y to commit X.
-Undestanding history: History diagrams
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Understanding history: History diagrams
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We will sometimes represent git history using diagrams like the one
below. Commits are shown as "o", and the links between them with
Note that git log starts with the most recent commit and works
backwards through the parents; however, since git history can contain
-multiple independant lines of development, the particular order that
+multiple independent lines of development, the particular order that
commits are listed in may be somewhat arbitrary.
Generating diffs
-------------------------------------------------
and git will prompt you for a commit message and then create the new
-commmit. Check to make sure it looks like what you expected with
+commit. Check to make sure it looks like what you expected with
-------------------------------------------------
$ git show
Document shallow clones? See draft 1.5.0 release notes for some
documentation.
-Add a sectin on working with other version control systems, including
+Add a section on working with other version control systems, including
CVS, Subversion, and just imports of series of release tarballs.
More details on gitweb?