..
.TH "GIT-ADD" 1 "" "" ""
.SH NAME
-git-add \- Add files to the index file.
+git-add \- Add files to the index file
.SH "SYNOPSIS"
..
.TH "GIT-APPLYPATCH" 1 "" "" ""
.SH NAME
-git-applypatch \- Apply one patch extracted from an e-mail.
+git-applypatch \- Apply one patch extracted from an e-mail
.SH "SYNOPSIS"
-git\-applypatch <msg> <patch> <info> [<signoff>]
+\fIgit\-applypatch\fR <msg> <patch> <info> [<signoff>]
.SH "DESCRIPTION"
-Takes three files <msg>, <patch>, and <info> prepared from an e\-mail message by git\-mailinfo, and creates a commit\&. It is usually not necessary to use this command directly\&.
+Takes three files <msg>, <patch>, and <info> prepared from an e\-mail message by \fIgit\-mailinfo\fR, and creates a commit\&. It is usually not necessary to use this command directly\&.
This command can run applypatch\-msg, pre\-applypatch, and post\-applypatch hooks\&. See hooks: \fIhooks.html\fR for more information\&.
..
.TH "GIT-BRANCH" 1 "" "" ""
.SH NAME
-git-branch \- Create a new branch, or remove an old one.
+git-branch \- Create a new branch, or remove an old one
.SH "SYNOPSIS"
-git\-branch [(\-d | \-D) <branchname>] | [[\-f] <branchname> [<start\-point>]]
+\fIgit\-branch\fR [(\-d | \-D) <branchname>] | [[\-f] <branchname> [<start\-point>]]
.SH "DESCRIPTION"
.TP
Start development off of a know tag
-.IP
+.nf
$ git clone git://git\&.kernel\&.org/pub/scm/\&.\&.\&./linux\-2\&.6 my2\&.6
$ cd my2\&.6
$ git branch my2\&.6\&.14 v2\&.6\&.14
$ git checkout my2\&.6\&.14
These two steps are the same as "checkout \-b my2\&.6\&.14 v2\&.6\&.14"\&.
+.fi
+
.TP
Delete unneeded branch
-.IP
+.nf
$ git clone git://git\&.kernel\&.org/\&.\&.\&./git\&.git my\&.git
$ cd my\&.git
$ git branch \-D todo
delete todo branch even if the "master" branch does not have all
commits from todo branch\&.
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-CHECK-REF-FORM" 1 "" "" ""
.SH NAME
-git-check-ref-format \- Make sure ref name is well formed.
+git-check-ref-format \- Make sure ref name is well formed
.SH "SYNOPSIS"
-git\-check\-ref\-format <refname>
+\fIgit\-check\-ref\-format\fR <refname>
.SH "DESCRIPTION"
-Checks if a given refname is acceptable, and exits non\-zero if it is not\&.
+Checks if a given \fIrefname\fR is acceptable, and exits non\-zero if it is not\&.
A reference is used in git to specify branches and tags\&. A branch head is stored under $GIT_DIR/refs/heads directory, and a tag is stored under $GIT_DIR/refs/tags directory\&. git imposes the following rules on how refs are named:
double\-dot \&.\&. are often used as in ref1\&.\&.ref2, and in some context this notation means ^ref1 ref2 (i\&.e\&. not in ref1 and in ref2)\&.
.TP
2.
-tilde ~ and caret ^ are used to introduce postfix nth parent and peel onion operation\&.
+tilde ~ and caret ^ are used to introduce postfix \fInth parent\fR and \fIpeel onion\fR operation\&.
.TP
3.
colon : is used as in srcref:dstref to mean "use srcref's value and store it in dstref" in fetch and push operations\&.
..
.TH "GIT-CHECKOUT" 1 "" "" ""
.SH NAME
-git-checkout \- Checkout and switch to a branch.
+git-checkout \- Checkout and switch to a branch
.SH "SYNOPSIS"
-git\-checkout [\-f] [\-b <new_branch>] [\-m] [<branch>] [<paths>...]
+\fIgit\-checkout\fR [\-f] [\-b <new_branch>] [\-m] [<branch>] [<paths>...]
.SH "DESCRIPTION"
When <paths> are not given, this command switches branches, by updating the index and working tree to reflect the specified branch, <branch>, and updating HEAD to be <branch> or, if specified, <new_branch>\&.
-When <paths> are given, this command does not switch branches\&. It updates the named paths in the working tree from the index file (i\&.e\&. it runs git\-checkout\-index \-f \-u)\&. In this case, \-f and \-b options are meaningless and giving either of them results in an error\&. <branch> argument can be used to specify a specific tree\-ish to update the index for the given paths before updating the working tree\&.
+When <paths> are given, this command does \fInot\fR switch branches\&. It updates the named paths in the working tree from the index file (i\&.e\&. it runs git\-checkout\-index \-f \-u)\&. In this case, \-f and \-b options are meaningless and giving either of them results in an error\&. <branch> argument can be used to specify a specific tree\-ish to update the index for the given paths before updating the working tree\&.
.SH "OPTIONS"
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\&.
-.IP
+.nf
$ git checkout master
$ git checkout master~2 Makefile
$ rm \-f hello\&.c
switch branch
take out a file out of other commit
- or "git checkout \-\- hello\&.c", as in the next example\&.If you have an unfortunate branch that is named hello\&.c, the last step above would be confused as an instruction to switch to that branch\&. You should instead write:
+ or "git checkout \-\- hello\&.c", as in the next example\&.
+.fi
+If you have an unfortunate branch that is named hello\&.c, the last step above would be confused as an instruction to switch to that branch\&. You should instead write:
-.IP
-$ git checkout \-\- hello\&.c.TP
+.nf
+$ git checkout \-\- hello\&.c
+.fi
+.TP
2.
After working in a wrong branch, switching to the correct branch you would want to is done with:
-.IP
-$ git checkout mytopicHowever, 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:
+.nf
+$ git checkout mytopic
+.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:
-.IP
+.nf
$ git checkout mytopic
-fatal: Entry 'frotz' not uptodate\&. Cannot merge\&.You can give the \-m flag to the command, which would try a three\-way merge:
+fatal: Entry 'frotz' not uptodate\&. Cannot merge\&.
+.fi
+You can give the \-m flag to the command, which would try a three\-way merge:
-.IP
+.nf
$ git checkout \-m mytopic
-Auto\-merging frotzAfter 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\&.
+Auto\-merging frotz
+.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
3.
When a merge conflict happens during switching branches with the \-m option, you would see something like this:
-.IP
+.nf
$ git checkout \-m mytopic
Auto\-merging frotz
merge: warning: conflicts during merge
ERROR: Merge conflict in frotz
-fatal: merge program failedAt 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 update\-index as usual:
+fatal: merge program failed
+.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 update\-index as usual:
-.IP
+.nf
$ edit frotz
-$ git update\-index frotz.LP
+$ git update\-index frotz
+.fi
+.LP
.SH "AUTHOR"
..
.TH "GIT-CHERRY-PICK" 1 "" "" ""
.SH NAME
-git-cherry-pick \- Apply the change introduced by an existing commit.
+git-cherry-pick \- Apply the change introduced by an existing commit
.SH "SYNOPSIS"
-git\-cherry\-pick [\-\-edit] [\-n] [\-r] <commit>
+\fIgit\-cherry\-pick\fR [\-\-edit] [\-n] [\-r] <commit>
.SH "DESCRIPTION"
.TP
\-r|\-\-replay
-Usually the command appends which commit was cherry\-picked after the original commit message when making a commit\&. This option, \-\-replay, causes it to use the original commit message intact\&. This is useful when you are reordering the patches in your private tree before publishing\&.
+Usually the command appends which commit was cherry\-picked after the original commit message when making a commit\&. This option, \fI\-\-replay\fR, causes it to use the original commit message intact\&. This is useful when you are reordering the patches in your private tree before publishing\&.
.TP
\-n|\-\-no\-commit
..
.TH "GIT-CHERRY" 1 "" "" ""
.SH NAME
-git-cherry \- Find commits not merged upstream.
+git-cherry \- Find commits not merged upstream
.SH "SYNOPSIS"
-git\-cherry [\-v] <upstream> [<head>]
+\fIgit\-cherry\fR [\-v] <upstream> [<head>]
.SH "DESCRIPTION"
-Each commit between the fork\-point and <head> is examined, and compared against the change each commit between the fork\-point and <upstream> introduces\&. Commits already included in upstream are prefixed with \- (meaning "drop from my local pull"), while commits missing from upstream are prefixed with + (meaning "add to the updated upstream")\&.
+Each commit between the fork\-point and <head> is examined, and compared against the change each commit between the fork\-point and <upstream> introduces\&. Commits already included in upstream are prefixed with \fI\-\fR (meaning "drop from my local pull"), while commits missing from upstream are prefixed with \fI+\fR (meaning "add to the updated upstream")\&.
.SH "OPTIONS"
..
.TH "GIT-CLONE-PACK" 1 "" "" ""
.SH NAME
-git-clone-pack \- Clones a repository by receiving packed objects.
+git-clone-pack \- Clones a repository by receiving packed objects
.SH "SYNOPSIS"
-git\-clone\-pack [\-\-exec=<git\-upload\-pack>] [<host>:]<directory> [<head>...]
+\fIgit\-clone\-pack\fR [\-\-exec=<git\-upload\-pack>] [<host>:]<directory> [<head>...]
.SH "DESCRIPTION"
-Clones a repository into the current repository by invoking git\-upload\-pack, possibly on the remote host via ssh, in the named repository, and stores the sent pack in the local repository\&.
+Clones a repository into the current repository by invoking \fIgit\-upload\-pack\fR, possibly on the remote host via ssh, in the named repository, and stores the sent pack in the local repository\&.
.SH "OPTIONS"
.TP
\-\-exec=<git\-upload\-pack>
-Use this to specify the path to git\-upload\-pack on the remote side, if it is not found on your $PATH\&. Installations of sshd ignore the user's environment setup scripts for login shells (e\&.g\&. \&.bash_profile) and your privately installed git may not be found on the system default $PATH\&. Another workaround suggested is to set up your $PATH in "\&.bashrc", but this flag is for people who do not want to pay the overhead for non\-interactive shells by having a lean \&.bashrc file (they set most of the things up in \&.bash_profile)\&.
+Use this to specify the path to \fIgit\-upload\-pack\fR on the remote side, if it is not found on your $PATH\&. Installations of sshd ignore the user's environment setup scripts for login shells (e\&.g\&. \&.bash_profile) and your privately installed git may not be found on the system default $PATH\&. Another workaround suggested is to set up your $PATH in "\&.bashrc", but this flag is for people who do not want to pay the overhead for non\-interactive shells by having a lean \&.bashrc file (they set most of the things up in \&.bash_profile)\&.
.TP
<host>
-A remote host that houses the repository\&. When this part is specified, git\-upload\-pack is invoked via ssh\&.
+A remote host that houses the repository\&. When this part is specified, \fIgit\-upload\-pack\fR is invoked via ssh\&.
.TP
<directory>
..
.TH "GIT-CLONE" 1 "" "" ""
.SH NAME
-git-clone \- Clones a repository.
+git-clone \- Clones a repository
.SH "SYNOPSIS"
.nf
-git\-clone [\-l [\-s]] [\-q] [\-n] [\-\-bare] [\-o <name>] [\-u <upload\-pack>]
+\fIgit\-clone\fR [\-l [\-s]] [\-q] [\-n] [\-\-bare] [\-o <name>] [\-u <upload\-pack>]
<repository> [<directory>]
.fi
.SH "OPTIONS"
.TP
-\-\-local, \-l,
+\-\-local, \-l
When the repository to clone from is on a local machine, this flag bypasses normal "git aware" transport mechanism and clones the repository by making a copy of HEAD and everything under objects and refs directories\&. The files under \&.git/objects/ directory are hardlinked to save space when possible\&.
.TP
-\-\-shared, \-s,
+\-\-shared, \-s
When the repository to clone is on the local machine, instead of using hard links, automatically setup \&.git/objects/info/alternatives to share the objects with the source repository\&. The resulting repository starts out without any object of its own\&.
.TP
-\-\-quiet, \-q,
+\-\-quiet, \-q
Operate quietly\&. This flag is passed to "rsync" and "git\-clone\-pack" commands when given\&.
.TP
.TP
\-\-bare
-Make a bare GIT repository\&. That is, instead of creating <directory> and placing the administrative files in <directory>/\&.git, make the <directory> itself the $GIT_DIR\&. This implies \-n option\&. When this option is used, neither the origin branch nor the default remotes/origin file is created\&.
+Make a \fIbare\fR GIT repository\&. That is, instead of creating <directory> and placing the administrative files in <directory>/\&.git, make the <directory> itself the $GIT_DIR\&. This implies \-n option\&. When this option is used, neither the origin branch nor the default remotes/origin file is created\&.
.TP
\-o <name>
-Instead of using the branch name origin to keep track of the upstream repository, use <name> instead\&. Note that the shorthand name stored in remotes/origin is not affected, but the local branch name to pull the remote master branch into is\&.
+Instead of using the branch name \fIorigin\fR to keep track of the upstream repository, use <name> instead\&. Note that the shorthand name stored in remotes/origin is not affected, but the local branch name to pull the remote master branch into is\&.
.TP
-\-\-upload\-pack <upload\-pack>, \-u <upload\-pack>,
-When given, and the repository to clone from is handled by git\-clone\-pack, \-\-exec=<upload\-pack> is passed to the command to specify non\-default path for the command run on the other end\&.
+\-\-upload\-pack <upload\-pack>, \-u <upload\-pack>
+When given, and the repository to clone from is handled by \fIgit\-clone\-pack\fR, \fI\-\-exec=<upload\-pack>\fR is passed to the command to specify non\-default path for the command run on the other end\&.
.TP
<repository>
.TP
Clone from upstream
-.IP
+.nf
$ git clone git://git\&.kernel\&.org/pub/scm/\&.\&.\&./linux\-2\&.6 my2\&.6
$ cd my2\&.6
$ make
+.fi
+
.TP
Make a local clone that borrows from the current directory, without checking things out
-.IP
+.nf
$ git clone \-l \-s \-n \&. \&.\&./copy
$ cd copy
$ git show\-branch
+.fi
+
.TP
Create a bare repository to publish your changes to the public
-.IP
+.nf
$ git clone \-\-bare \-l /home/proj/\&.git /pub/scm/proj\&.git
+.fi
+
.TP
Create a repository on the kernel\&.org machine that borrows from Linus
-.IP
+.nf
$ git clone \-\-bare \-l \-s /pub/scm/\&.\&.\&./torvalds/linux\-2\&.6\&.git \\
/pub/scm/\&.\&.\&./me/subsys\-2\&.6\&.git
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-COUNT-OBJECTS" 1 "" "" ""
.SH NAME
-git-count-objects \- Reports on unpacked objects.
+git-count-objects \- Reports on unpacked objects
.SH "SYNOPSIS"
-git\-count\-objects
+\fIgit\-count\-objects\fR
.SH "DESCRIPTION"
..
.TH "GIT-DAEMON" 1 "" "" ""
.SH NAME
-git-daemon \- A really simple server for git repositories.
+git-daemon \- A really simple server for git repositories
.SH "SYNOPSIS"
.nf
..
.TH "GIT-DESCRIBE" 1 "" "" ""
.SH NAME
-git-describe \- Show the most recent tag that is reachable from a commit.
+git-describe \- Show the most recent tag that is reachable from a commit
.SH "SYNOPSIS"
-git\-describe [\-\-all] [\-\-tags] [\-\-abbrev=<n>] <committish>...
+\fIgit\-describe\fR [\-\-all] [\-\-tags] [\-\-abbrev=<n>] <committish>...
.SH "DESCRIPTION"
..
.TH "GIT-DIFF-STAGES" 1 "" "" ""
.SH NAME
-git-diff-stages \- Compares content and mode of blobs between stages in an unmerged index file.
+git-diff-stages \- Compares content and mode of blobs between stages in an unmerged index file
.SH "SYNOPSIS"
An output line is formatted this way:
-.IP
+.nf
in\-place edit :100644 100644 bcd1234\&.\&.\&. 0123456\&.\&.\&. M file0
copy\-edit :100644 100644 abcd123\&.\&.\&. 1234567\&.\&.\&. C68 file1 file2
rename\-edit :100644 100644 abcd123\&.\&.\&. 1234567\&.\&.\&. R86 file1 file3
create :000000 100644 0000000\&.\&.\&. 1234567\&.\&.\&. A file4
delete :100644 000000 1234567\&.\&.\&. 0000000\&.\&.\&. D file5
unmerged :000000 000000 0000000\&.\&.\&. 0000000\&.\&.\&. U file6
+.fi
+
That is, from the left to the right:
Example:
-.IP
+.nf
:100644 100644 5be4a4\&.\&.\&.\&.\&.\&. 000000\&.\&.\&.\&.\&.\&. M file\&.c
+.fi
+
When \-z option is not used, TAB, LF, and backslash characters in pathnames are represented as \\t, \\n, and \\\\, respectively\&.
git\-diff\-tree and git\-diff\-files can take \fI\-c\fR or \fI\-\-cc\fR option to produce \fIcombined diff\fR, which looks like this:
-.IP
+.nf
diff \-\-combined describe\&.c
@@@ +98,7 @@@
return (a_date > b_date) ? \-1 : (a_date == b_date) ? 0 : 1;
{
+ unsigned char sha1[20];
+ struct commit *cmit;
+.fi
+
Unlike the traditional \fIunified\fR diff format, which shows two files A and B with a single column that has \- (minus -- appears in A but removed in B), + (plus -- missing in A but added to B), or (space -- unchanged) prefix, this format compares two or more files file1, file2,... with one file X, and shows how X differs from each of fileN\&. One column for each of fileN is prepended to the output line to note how X's line is different from it\&.
..
.TH "GIT-DIFF" 1 "" "" ""
.SH NAME
-git-diff \- Show changes between commits, commit and working tree, etc.
+git-diff \- Show changes between commits, commit and working tree, etc
.SH "SYNOPSIS"
-git\-diff [ \-\-diff\-options ] <ent>{0,2} [<path>...]
+\fIgit\-diff\fR [ \-\-diff\-options ] <ent>{0,2} [<path>...]
.SH "DESCRIPTION"
.TP
\-\-diff\-options
- \-\-diff\-options are passed to the git\-diff\-files, git\-diff\-index, and git\-diff\-tree commands\&. See the documentation for these commands for description\&.
+ \fI\-\-diff\-options\fR are passed to the git\-diff\-files, git\-diff\-index, and git\-diff\-tree commands\&. See the documentation for these commands for description\&.
.TP
<path>...
.TP
Various ways to check your working tree
-.IP
+.nf
$ git diff
$ git diff \-\-cached
$ git diff HEAD
would be committing if you run "git commit" without "\-a" option\&.
changes in the working tree since your last commit; what you
would be committing if you run "git commit \-a"
+.fi
+
.TP
Comparing with arbitrary commits
-.IP
+.nf
$ git diff test
$ git diff HEAD \-\- \&./test
$ git diff HEAD^ HEAD
the tip of the current branch, but limit the comparison to the
file "test"\&.
compare the version before the last commit and the last commit\&.
+.fi
+
.TP
Limiting the diff output
-.IP
+.nf
$ git diff \-\-diff\-filter=MRC
$ git diff \-\-name\-status \-r
$ git diff arch/i386 include/asm\-i386
you would only see the directory name if there is a change in a
file in a subdirectory\&.
limit diff output to named subtrees\&.
+.fi
+
.TP
Munging the diff output
-.IP
+.nf
$ git diff \-\-find\-copies\-harder \-B \-C
$ git diff \-R
spend extra cycles to find renames, copies and complete
rewrites (very expensive)\&.
output diff in reverse\&.
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-FETCH-PACK" 1 "" "" ""
.SH NAME
-git-fetch-pack \- Receive missing objects from another repository.
+git-fetch-pack \- Receive missing objects from another repository
.SH "SYNOPSIS"
..
.TH "GIT-FETCH" 1 "" "" ""
.SH NAME
-git-fetch \- Download objects and a head from another repository.
+git-fetch \- Download objects and a head from another repository
.SH "SYNOPSIS"
..
.TH "GIT-FORMAT-PATCH" 1 "" "" ""
.SH NAME
-git-format-patch \- Prepare patches for e-mail submission.
+git-format-patch \- Prepare patches for e-mail submission
.SH "SYNOPSIS"
.nf
..
.TH "GIT-GET-TAR-COMMIT" 1 "" "" ""
.SH NAME
-git-get-tar-commit-id \- Extract commit ID from an archive created using git-tar-tree.
+git-get-tar-commit-id \- Extract commit ID from an archive created using git-tar-tree
.SH "SYNOPSIS"
-git\-get\-tar\-commit\-id < <tarfile>
+\fIgit\-get\-tar\-commit\-id\fR < <tarfile>
.SH "DESCRIPTION"
..
.TH "GIT-GREP" 1 "" "" ""
.SH NAME
-git-grep \- print lines matching a pattern
+git-grep \- Print lines matching a pattern
.SH "SYNOPSIS"
-git\-grep [<option>...] [\-e] <pattern> [\-\-] [<path>...]
+\fIgit\-grep\fR [<option>...] [\-e] <pattern> [\-\-] [<path>...]
.SH "DESCRIPTION"
..
.TH "GIT-HASH-OBJECT" 1 "" "" ""
.SH NAME
-git-hash-object \- Computes object ID and optionally creates a blob from a file.
+git-hash-object \- Computes object ID and optionally creates a blob from a file
.SH "SYNOPSIS"
-git\-hash\-object [\-t <type>] [\-w] [\-\-stdin] [\-\-] <file>...
+\fIgit\-hash\-object\fR [\-t <type>] [\-w] [\-\-stdin] [\-\-] <file>...
.SH "DESCRIPTION"
..
.TH "GIT-HTTP-PUSH" 1 "" "" ""
.SH NAME
-git-http-push \- Push missing objects using HTTP/DAV.
+git-http-push \- Push missing objects using HTTP/DAV
.SH "SYNOPSIS"
-git\-http\-push [\-\-complete] [\-\-force] [\-\-verbose] <url> <ref> [<ref>...]
+\fIgit\-http\-push\fR [\-\-complete] [\-\-force] [\-\-verbose] <url> <ref> [<ref>...]
.SH "DESCRIPTION"
.SH "SPECIFYING THE REFS"
-A <ref> specification can be either a single pattern, or a pair of such patterns separated by a colon ":" (this means that a ref name cannot have a colon in it)\&. A single pattern <name> is just a shorthand for <name>:<name>\&.
+A \fI<ref>\fR specification can be either a single pattern, or a pair of such patterns separated by a colon ":" (this means that a ref name cannot have a colon in it)\&. A single pattern \fI<name>\fR is just a shorthand for \fI<name>:<name>\fR\&.
Each pattern pair consists of the source side (before the colon) and the destination side (after the colon)\&. The ref to be pushed is determined by finding a match that matches the source side, and where it is pushed is determined by using the destination side\&.
.LP
-Without \-\-force, the <src> ref is stored at the remote only if <dst> does not exist, or <dst> is a proper subset (i\&.e\&. an ancestor) of <src>\&. This check, known as "fast forward check", is performed in order to avoid accidentally overwriting the remote ref and lose other peoples' commits from there\&.
+Without \fI\-\-force\fR, the <src> ref is stored at the remote only if <dst> does not exist, or <dst> is a proper subset (i\&.e\&. an ancestor) of <src>\&. This check, known as "fast forward check", is performed in order to avoid accidentally overwriting the remote ref and lose other peoples' commits from there\&.
-With \-\-force, the fast forward check is disabled for all refs\&.
+With \fI\-\-force\fR, the fast forward check is disabled for all refs\&.
-Optionally, a <ref> parameter can be prefixed with a plus + sign to disable the fast\-forward check only on that ref\&.
+Optionally, a <ref> parameter can be prefixed with a plus \fI+\fR sign to disable the fast\-forward check only on that ref\&.
.SH "AUTHOR"
..
.TH "GIT-LOST-FOUND" 1 "" "" ""
.SH NAME
-git-lost-found \- Recover lost refs that luckily have not yet been pruned.
+git-lost-found \- Recover lost refs that luckily have not yet been pruned
.SH "SYNOPSIS"
-git\-lost\-found
+\fIgit\-lost\-found\fR
.SH "DESCRIPTION"
.SH "EXAMPLE"
-Suppose you run git tag \-f and mistyped the tag to overwrite\&. The ref to your tag is overwritten, but until you run git prune, it is still there\&.
+Suppose you run \fIgit tag \-f\fR and mistyped the tag to overwrite\&. The ref to your tag is overwritten, but until you run \fIgit prune\fR, it is still there\&.
-.IP
+.nf
$ git lost\-found
[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0\&.99\&.9c
\&.\&.\&.
+.fi
+
Also you can use gitk to browse how they relate to each other and existing (probably old) tags\&.
-.IP
+.nf
$ gitk $(cd \&.git/lost\-found/commit && echo ??*)
+.fi
+
After making sure that it is the object you are looking for, you can reconnect it to your regular \&.git/refs hierarchy\&.
-.IP
+.nf
$ 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
+.fi
+
.SH "AUTHOR"
-Written by Junio C Hamano 濱野 純 <junkio@cox\&.net>
+Written by Junio C Hamano 濱野 純 <junkio@cox\&.net>
.SH "DOCUMENTATION"
..
.TH "GIT-LS-REMOTE" 1 "" "" ""
.SH NAME
-git-ls-remote \- Look at references other repository has.
+git-ls-remote \- Look at references other repository has
.SH "SYNOPSIS"
-git\-ls\-remote [\-\-heads] [\-\-tags] <repository> <refs>...
+\fIgit\-ls\-remote\fR [\-\-heads] [\-\-tags] <repository> <refs>...
.SH "DESCRIPTION"
..
.TH "GIT-LS-TREE" 1 "" "" ""
.SH NAME
-git-ls-tree \- Lists the contents of a tree object.
+git-ls-tree \- Lists the contents of a tree object
.SH "SYNOPSIS"
-git\-ls\-tree [\-d] [\-r] [\-t] [\-z] [\-\-name\-only] [\-\-name\-status] <tree\-ish> [paths...]
+\fIgit\-ls\-tree\fR [\-d] [\-r] [\-t] [\-z] [\-\-name\-only] [\-\-name\-status] <tree\-ish> [paths...]
.SH "DESCRIPTION"
-Lists the contents of a given tree object, like what "/bin/ls \-a" does in the current working directory\&. Note that the usage is subtly different, though \- paths denote just a list of patterns to match, e\&.g\&. so specifying directory name (without \-r) will behave differently, and order of the arguments does not matter\&.
+Lists the contents of a given tree object, like what "/bin/ls \-a" does in the current working directory\&. Note that the usage is subtly different, though \- \fIpaths\fR denote just a list of patterns to match, e\&.g\&. so specifying directory name (without \fI\-r\fR) will behave differently, and order of the arguments does not matter\&.
.SH "OPTIONS"
.TP
\-t
-Show tree entries even when going to recurse them\&. Has no effect if \-r was not passed\&. \-d implies \-t\&.
+Show tree entries even when going to recurse them\&. Has no effect if \fI\-r\fR was not passed\&. \fI\-d\fR implies \fI\-t\fR\&.
.TP
\-z
\\0 line termination on output\&.
.TP
-\-\-name\-only, \-\-name\-status,
+\-\-name\-only, \-\-name\-status
List only filenames (instead of the "long" output), one per line\&.
.TP
..
.TH "GIT-MAILINFO" 1 "" "" ""
.SH NAME
-git-mailinfo \- Extracts patch from a single e-mail message.
+git-mailinfo \- Extracts patch from a single e-mail message
.SH "SYNOPSIS"
-git\-mailinfo [\-k] [\-u | \-\-encoding=<encoding>] <msg> <patch>
+\fIgit\-mailinfo\fR [\-k] [\-u | \-\-encoding=<encoding>] <msg> <patch>
.SH "DESCRIPTION"
.TP
\-k
-Usually the program cleans up the Subject: header line to extract the title line for the commit log message, among which (1) remove Re: or re:, (2) leading whitespaces, (3) [ up to ], typically [PATCH], and then prepends "[PATCH] "\&. This flag forbids this munging, and is most useful when used to read back git format\-patch \-\-mbox output\&.
+Usually the program \fIcleans up\fR the Subject: header line to extract the title line for the commit log message, among which (1) remove \fIRe:\fR or \fIre:\fR, (2) leading whitespaces, (3) \fI[\fR up to \fI]\fR, typically \fI[PATCH]\fR, and then prepends "[PATCH] "\&. This flag forbids this munging, and is most useful when used to read back \fIgit format\-patch \-\-mbox\fR output\&.
.TP
\-u
..
.TH "GIT-MAILSPLIT" 1 "" "" ""
.SH NAME
-git-mailsplit \- Totally braindamaged mbox splitter program.
+git-mailsplit \- Totally braindamaged mbox splitter program
.SH "SYNOPSIS"
-git\-mailsplit [\-b] [\-f<nn>] [\-d<prec>] \-o<directory> [\-\-] [<mbox>...]
+\fIgit\-mailsplit\fR [\-b] [\-f<nn>] [\-d<prec>] \-o<directory> [\-\-] [<mbox>...]
.SH "DESCRIPTION"
..
.TH "GIT-MV" 1 "" "" ""
.SH NAME
-git-mv \- Script used to move or rename a file, directory or symlink.
+git-mv \- Move or rename a file, directory or symlink
.SH "SYNOPSIS"
-git\-mv <options>... <args>...
+\fIgit\-mv\fR <options>... <args>...
.SH "DESCRIPTION"
.TP
\-k
-Skip move or rename actions which would lead to an error condition\&. An error happens when a source is neither existing nor controlled by GIT, or when it would overwrite an existing file unless \-f is given\&.
+Skip move or rename actions which would lead to an error condition\&. An error happens when a source is neither existing nor controlled by GIT, or when it would overwrite an existing file unless \fI\-f\fR is given\&.
.TP
\-n
..
.TH "GIT-NAME-REV" 1 "" "" ""
.SH NAME
-git-name-rev \- Find symbolic names for given revs.
+git-name-rev \- Find symbolic names for given revs
.SH "SYNOPSIS"
-git\-name\-rev [\-\-tags] ( \-\-all | \-\-stdin | <commitish>... )
+\fIgit\-name\-rev\fR [\-\-tags] ( \-\-all | \-\-stdin | <commitish>... )
.SH "DESCRIPTION"
Enter git\-name\-rev:
-.IP
+.nf
% git name\-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
+.fi
+
Now you are wiser, because you know that it happened 940 revisions before v0\&.99\&.
Another nice thing you can do is:
-.IP
+.nf
% git log | git name\-rev \-\-stdin
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-PACK-OBJECTS" 1 "" "" ""
.SH NAME
-git-pack-objects \- Create a packed archive of objects.
+git-pack-objects \- Create a packed archive of objects
.SH "SYNOPSIS"
.nf
..
.TH "GIT-PACK-REDUNDANT" 1 "" "" ""
.SH NAME
-git-pack-redundant \- Program used to find redundant pack files.
+git-pack-redundant \- Program used to find redundant pack files
.SH "SYNOPSIS"
..
.TH "GIT-PATCH-ID" 1 "" "" ""
.SH NAME
-git-patch-id \- Generate a patch ID.
+git-patch-id \- Generate a patch ID
.SH "SYNOPSIS"
-git\-patch\-id < <patch>
+\fIgit\-patch\-id\fR < <patch>
.SH "DESCRIPTION"
..
.TH "GIT-PEEK-REMOTE" 1 "" "" ""
.SH NAME
-git-peek-remote \- Lists the references in a remote repository.
+git-peek-remote \- Lists the references in a remote repository
.SH "SYNOPSIS"
-git\-peek\-remote [\-\-exec=<git\-upload\-pack>] [<host>:]<directory>
+\fIgit\-peek\-remote\fR [\-\-exec=<git\-upload\-pack>] [<host>:]<directory>
.SH "DESCRIPTION"
.TP
\-\-exec=<git\-upload\-pack>
-Use this to specify the path to git\-upload\-pack on the remote side, if it is not found on your $PATH\&. Some installations of sshd ignores the user's environment setup scripts for login shells (e\&.g\&. \&.bash_profile) and your privately installed git may not be found on the system default $PATH\&. Another workaround suggested is to set up your $PATH in "\&.bashrc", but this flag is for people who do not want to pay the overhead for non\-interactive shells, but prefer having a lean \&.bashrc file (they set most of the things up in \&.bash_profile)\&.
+Use this to specify the path to \fIgit\-upload\-pack\fR on the remote side, if it is not found on your $PATH\&. Some installations of sshd ignores the user's environment setup scripts for login shells (e\&.g\&. \&.bash_profile) and your privately installed git may not be found on the system default $PATH\&. Another workaround suggested is to set up your $PATH in "\&.bashrc", but this flag is for people who do not want to pay the overhead for non\-interactive shells, but prefer having a lean \&.bashrc file (they set most of the things up in \&.bash_profile)\&.
.TP
<host>
-A remote host that houses the repository\&. When this part is specified, git\-upload\-pack is invoked via ssh\&.
+A remote host that houses the repository\&. When this part is specified, \fIgit\-upload\-pack\fR is invoked via ssh\&.
.TP
<directory>
..
.TH "GIT-PULL" 1 "" "" ""
.SH NAME
-git-pull \- Pull and merge from another repository.
+git-pull \- Pull and merge from another repository
.SH "SYNOPSIS"
.TP
Command line pull of multiple branches from one repository
-.IP
+.nf
$ cat \&.git/remotes/origin
URL: git://git\&.kernel\&.org/pub/scm/git/git\&.git
Pull: master:origin
$ git checkout master
$ git fetch origin master:origin +pu:pu maint:maint
-$ git pull \&. originHere, a typical \&.git/remotes/origin file from a git\-clone operation is used in combination with command line options to git\-fetch to first update multiple branches of the local repository and then to merge the remote origin branch into the local master branch\&. The local pu branch is updated even if it does not result in a fast forward update\&. Here, the pull can obtain its objects from the local repository using \&., as the previous git\-fetch is known to have already obtained and made available all the necessary objects\&.
+$ git pull \&. origin
+.fi
+Here, a typical \&.git/remotes/origin file from a git\-clone operation is used in combination with command line options to git\-fetch to first update multiple branches of the local repository and then to merge the remote origin branch into the local master branch\&. The local pu branch is updated even if it does not result in a fast forward update\&. Here, the pull can obtain its objects from the local repository using \&., as the previous git\-fetch is known to have already obtained and made available all the necessary objects\&.
.TP
Pull of multiple branches from one repository using \&.git/remotes file
-.IP
+.nf
$ cat \&.git/remotes/origin
URL: git://git\&.kernel\&.org/pub/scm/git/git\&.git
Pull: master:origin
Pull: maint:maint
$ git checkout master
-$ git pull originHere, a typical \&.git/remotes/origin file from a git\-clone operation has been hand\-modified to include the branch\-mapping of additional remote and local heads directly\&. A single git\-pull operation while in the master branch will fetch multiple heads and merge the remote origin head into the current, local master branch\&.
+$ git pull origin
+.fi
+Here, a typical \&.git/remotes/origin file from a git\-clone operation has been hand\-modified to include the branch\-mapping of additional remote and local heads directly\&. A single git\-pull operation while in the master branch will fetch multiple heads and merge the remote origin head into the current, local master branch\&.
If you tried a pull which resulted in a complex conflicts and would want to start over, you can recover with \fBgit\-reset\fR(1)\&.
..
.TH "GIT-PUSH" 1 "" "" ""
.SH NAME
-git-push \- Update remote refs along with associated objects.
+git-push \- Update remote refs along with associated objects
.SH "SYNOPSIS"
..
.TH "GIT-REBASE" 1 "" "" ""
.SH NAME
-git-rebase \- Rebase local commits to new upstream head.
+git-rebase \- Rebase local commits to new upstream head
.SH "SYNOPSIS"
..
.TH "GIT-RELINK" 1 "" "" ""
.SH NAME
-git-relink \- Hardlink common objects in local repositories.
+git-relink \- Hardlink common objects in local repositories
.SH "SYNOPSIS"
-git\-relink [\-\-safe] <dir> <dir> [<dir>]*
+\fIgit\-relink\fR [\-\-safe] <dir> <dir> [<dir>]*
.SH "DESCRIPTION"
..
.TH "GIT-REPO-CONFIG" 1 "" "" ""
.SH NAME
-git-repo-config \- Get and set options in .git/config.
+git-repo-config \- Get and set options in .git/config
.SH "SYNOPSIS"
.nf
you can set the filemode to true with
-.IP
+.nf
% git repo\-config core\&.filemode true
+.fi
+
The hypothetic proxy command entries actually have a postfix to discern to what URL they apply\&. Here is how to change the entry for kernel\&.org to "ssh"\&.
-.IP
+.nf
% git repo\-config proxy\&.command '"ssh" for kernel\&.org' 'for kernel\&.org$'
+.fi
+
This makes sure that only the key/value pair for kernel\&.org is replaced\&.
To delete the entry for renames, do
-.IP
+.nf
% git repo\-config \-\-unset diff\&.renames
+.fi
+
If you want to delete an entry for a multivar (like proxy\&.command above), you have to provide a regex matching the value of exactly one line\&.
To query the value for a given key, do
-.IP
+.nf
% git repo\-config \-\-get core\&.filemode
+.fi
+
or
-.IP
+.nf
% git repo\-config core\&.filemode
+.fi
+
or, to query a multivar:
-.IP
+.nf
% git repo\-config \-\-get proxy\&.command "for kernel\&.org$"
+.fi
+
If you want to know all the values for a multivar, do:
-.IP
+.nf
% git repo\-config \-\-get\-all proxy\&.command
+.fi
+
If you like to live dangerous, you can replace \fIall\fR proxy\&.commands by a new one with
-.IP
+.nf
% git repo\-config \-\-replace\-all proxy\&.command ssh
+.fi
+
However, if you really only want to replace the line for the default proxy, i\&.e\&. the one without a "for ..." postfix, do something like this:
-.IP
+.nf
% git repo\-config proxy\&.command ssh '! for '
+.fi
+
To actually match only values with an exclamation mark, you have to
-.IP
+.nf
% git repo\-config section\&.key value '[!]'
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-REQUEST-PULL" 1 "" "" ""
.SH NAME
-git-request-pull \- Generates a summary of pending changes.
+git-request-pull \- Generates a summary of pending changes
.SH "SYNOPSIS"
-git\-request\-pull <start> <url> [<end>]
+\fIgit\-request\-pull\fR <start> <url> [<end>]
.SH "DESCRIPTION"
..
.TH "GIT-RESET" 1 "" "" ""
.SH NAME
-git-reset \- Reset current HEAD to the specified state.
+git-reset \- Reset current HEAD to the specified state
.SH "SYNOPSIS"
-git\-reset [\-\-mixed | \-\-soft | \-\-hard] [<commit\-ish>]
+\fIgit\-reset\fR [\-\-mixed | \-\-soft | \-\-hard] [<commit\-ish>]
.SH "DESCRIPTION"
.TP
Undo a commit and redo
-.IP
+.nf
$ git commit \&.\&.\&.
$ git reset \-\-soft HEAD^
$ edit
"reset" copies the old head to \&.git/ORIG_HEAD; redo the
commit by starting with its log message\&. If you do not need to
edit the message further, you can give \-C option instead\&.
+.fi
+
.TP
Undo commits permanently
-.IP
+.nf
$ git commit \&.\&.\&.
$ git reset \-\-hard HEAD~3
The last three commits (HEAD, HEAD^, and HEAD~2) were bad
and you do not want to ever see them again\&. Do *not* do this if
you have already given these commits to somebody else\&.
+.fi
+
.TP
Undo a commit, making it a topic branch
-.IP
+.nf
$ git branch topic/wip
$ git reset \-\-hard HEAD~3
$ git checkout topic/wip
current HEAD\&.
Rewind the master branch to get rid of those three commits\&.
Switch to "topic/wip" branch and keep working\&.
+.fi
+
.TP
Undo update\-index
-.IP
+.nf
$ edit
$ git\-update\-index frotz\&.c filfre\&.c
$ mailx
remain there\&.
then you can pull and merge, leaving frotz\&.c and filfre\&.c
changes still in the working tree\&.
+.fi
+
.TP
Undo a merge or pull
-.IP
+.nf
$ git pull
Trying really trivial in\-index merge\&.\&.\&.
fatal: Merge requires file\-level merging
tip of the current branch in ORIG_HEAD, so resetting hard to it
brings your index file and the working tree back to that state,
and resets the tip of the branch to that commit\&.
+.fi
+
.TP
Interrupted workflow
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\&.
-.IP
+.nf
$ git checkout feature ;# you were working in "feature" branch and
$ work work work ;# got interrupted
$ git commit \-a \-m 'snapshot WIP'
After , the index file still has all the WIP changes you
committed in \&. This sets it to the last commit you were
basing the WIP changes on\&.
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-REV-PARSE" 1 "" "" ""
.SH NAME
-git-rev-parse \- Pick out and massage parameters.
+git-rev-parse \- Pick out and massage parameters
.SH "SYNOPSIS"
..
.TH "GIT-REVERT" 1 "" "" ""
.SH NAME
-git-revert \- Revert an existing commit.
+git-revert \- Revert an existing commit
.SH "SYNOPSIS"
-git\-revert [\-\-edit | \-\-no\-edit] [\-n] <commit>
+\fIgit\-revert\fR [\-\-edit | \-\-no\-edit] [\-n] <commit>
.SH "DESCRIPTION"
..
.TH "GIT-RM" 1 "" "" ""
.SH NAME
-git-rm \- Remove files from the working tree and from the index.
+git-rm \- Remove files from the working tree and from the index
.SH "SYNOPSIS"
..
.TH "GIT-SEND-PACK" 1 "" "" ""
.SH NAME
-git-send-pack \- Push missing objects packed.
+git-send-pack \- Push missing objects packed
.SH "SYNOPSIS"
-git\-send\-pack [\-\-all] [\-\-force] [\-\-exec=<git\-receive\-pack>] [<host>:]<directory> [<ref>...]
+\fIgit\-send\-pack\fR [\-\-all] [\-\-force] [\-\-exec=<git\-receive\-pack>] [<host>:]<directory> [<ref>...]
.SH "DESCRIPTION"
-Invokes git\-receive\-pack on a possibly remote repository, and updates it from the current repository, sending named refs\&.
+Invokes \fIgit\-receive\-pack\fR on a possibly remote repository, and updates it from the current repository, sending named refs\&.
.SH "OPTIONS"
.TP
\-\-exec=<git\-receive\-pack>
-Path to the git\-receive\-pack program on the remote end\&. Sometimes useful when pushing to a remote repository over ssh, and you do not have the program in a directory on the default $PATH\&.
+Path to the \fIgit\-receive\-pack\fR program on the remote end\&. Sometimes useful when pushing to a remote repository over ssh, and you do not have the program in a directory on the default $PATH\&.
.TP
\-\-all
.TP
<host>
-A remote host to house the repository\&. When this part is specified, git\-receive\-pack is invoked via ssh\&.
+A remote host to house the repository\&. When this part is specified, \fIgit\-receive\-pack\fR is invoked via ssh\&.
.TP
<directory>
There are three ways to specify which refs to update on the remote end\&.
-With \-\-all flag, all refs that exist locally are transfered to the remote side\&. You cannot specify any <ref> if you use this flag\&.
+With \fI\-\-all\fR flag, all refs that exist locally are transfered to the remote side\&. You cannot specify any \fI<ref>\fR if you use this flag\&.
-Without \-\-all and without any <ref>, the refs that exist both on the local side and on the remote side are updated\&.
+Without \fI\-\-all\fR and without any \fI<ref>\fR, the refs that exist both on the local side and on the remote side are updated\&.
-When one or more <ref> are specified explicitly, it can be either a single pattern, or a pair of such pattern separated by a colon ":" (this means that a ref name cannot have a colon in it)\&. A single pattern <name> is just a shorthand for <name>:<name>\&.
+When one or more \fI<ref>\fR are specified explicitly, it can be either a single pattern, or a pair of such pattern separated by a colon ":" (this means that a ref name cannot have a colon in it)\&. A single pattern \fI<name>\fR is just a shorthand for \fI<name>:<name>\fR\&.
Each pattern pair consists of the source side (before the colon) and the destination side (after the colon)\&. The ref to be pushed is determined by finding a match that matches the source side, and where it is pushed is determined by using the destination side\&.
.LP
-Without \-\-force, the <src> ref is stored at the remote only if <dst> does not exist, or <dst> is a proper subset (i\&.e\&. an ancestor) of <src>\&. This check, known as "fast forward check", is performed in order to avoid accidentally overwriting the remote ref and lose other peoples' commits from there\&.
+Without \fI\-\-force\fR, the <src> ref is stored at the remote only if <dst> does not exist, or <dst> is a proper subset (i\&.e\&. an ancestor) of <src>\&. This check, known as "fast forward check", is performed in order to avoid accidentally overwriting the remote ref and lose other peoples' commits from there\&.
-With \-\-force, the fast forward check is disabled for all refs\&.
+With \fI\-\-force\fR, the fast forward check is disabled for all refs\&.
-Optionally, a <ref> parameter can be prefixed with a plus + sign to disable the fast\-forward check only on that ref\&.
+Optionally, a <ref> parameter can be prefixed with a plus \fI+\fR sign to disable the fast\-forward check only on that ref\&.
.SH "AUTHOR"
..
.TH "GIT-SH-SETUP" 1 "" "" ""
.SH NAME
-git-sh-setup \- Common git shell script setup code.
+git-sh-setup \- Common git shell script setup code
.SH "SYNOPSIS"
-git\-sh\-setup
+\fIgit\-sh\-setup\fR
.SH "DESCRIPTION"
Sets up the normal git environment variables and a few helper functions (currently just "die()"), and returns ok if it all looks like a git archive\&. So, to make the rest of the git scripts more careful and readable, use it as follows:
-.IP
+.nf
\&. git\-sh\-setup || die "Not a git archive"
+.fi
+
.SH "AUTHOR"
..
.TH "GIT-SHORTLOG" 1 "" "" ""
.SH NAME
-git-shortlog \- Summarize 'git log' output.
+git-shortlog \- Summarize 'git log' output
.SH "SYNOPSIS"
..
.TH "GIT-SHOW-BRANCH" 1 "" "" ""
.SH NAME
-git-show-branch \- Show branches and their commits.
+git-show-branch \- Show branches and their commits
.SH "SYNOPSIS"
.nf
The following example shows three branches, "master", "fixes" and "mhf":
-.IP
+.nf
$ 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'\&.
+.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"\&.
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:
-.IP
+.nf
[showbranch]
default = \-\-topo\-order
default = heads/*
+.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\&.
..
.TH "GIT-SHOW" 1 "" "" ""
.SH NAME
-git-show \- Show one commit with difference it introduces.
+git-show \- Show one commit with difference it introduces
.SH "SYNOPSIS"
..
.TH "GIT-STATUS" 1 "" "" ""
.SH NAME
-git-status \- Show working tree status.
+git-status \- Show working tree status
.SH "SYNOPSIS"
-git\-status
+\fIgit\-status\fR
.SH "DESCRIPTION"
-Examines paths in the working tree that has changes unrecorded to the index file, and changes between the index file and the current HEAD commit\&. The former paths are what you _could_ commit by running git\-update\-index before running git commit, and the latter paths are what you _would_ commit by running git commit\&.
+Examines paths in the working tree that has changes unrecorded to the index file, and changes between the index file and the current HEAD commit\&. The former paths are what you _could_ commit by running \fIgit\-update\-index\fR before running \fIgit commit\fR, and the latter paths are what you _would_ commit by running \fIgit commit\fR\&.
If there is no path that is different between the index file and the current HEAD commit, the command exits with non\-zero status\&.
.SH "OUTPUT"
-The output from this command is designed to be used as a commit template comments, and all the output lines are prefixed with #\&.
+The output from this command is designed to be used as a commit template comments, and all the output lines are prefixed with \fI#\fR\&.
.SH "AUTHOR"
..
.TH "GIT-STRIPSPACE" 1 "" "" ""
.SH NAME
-git-stripspace \- Filter out empty lines.
+git-stripspace \- Filter out empty lines
.SH "SYNOPSIS"
-git\-stripspace < <stream>
+\fIgit\-stripspace\fR < <stream>
.SH "DESCRIPTION"
..
.TH "GIT-UNPACK-OBJECTS" 1 "" "" ""
.SH NAME
-git-unpack-objects \- Unpack objects from a packed archive.
+git-unpack-objects \- Unpack objects from a packed archive
.SH "SYNOPSIS"
-git\-unpack\-objects [\-n] [\-q] <pack\-file
+\fIgit\-unpack\-objects\fR [\-n] [\-q] <pack\-file
.SH "DESCRIPTION"
..
.TH "GIT-UPLOAD-PACK" 1 "" "" ""
.SH NAME
-git-upload-pack \- Send missing objects packed.
+git-upload-pack \- Send missing objects packed
.SH "SYNOPSIS"
-git\-upload\-pack <directory>
+\fIgit\-upload\-pack\fR <directory>
.SH "DESCRIPTION"
-Invoked by git\-clone\-pack and/or git\-fetch\-pack, learns what objects the other side is missing, and sends them after packing\&.
+Invoked by \fIgit\-clone\-pack\fR and/or \fIgit\-fetch\-pack\fR, learns what objects the other side is missing, and sends them after packing\&.
-This command is usually not invoked directly by the end user\&. The UI for the protocol is on the git\-fetch\-pack side, and the program pair is meant to be used to pull updates from a remote repository\&. For push operations, see git\-send\-pack\&.
+This command is usually not invoked directly by the end user\&. The UI for the protocol is on the \fIgit\-fetch\-pack\fR side, and the program pair is meant to be used to pull updates from a remote repository\&. For push operations, see \fIgit\-send\-pack\fR\&.
.SH "OPTIONS"
..
.TH "GIT-VERIFY-PACK" 1 "" "" ""
.SH NAME
-git-verify-pack \- Validate packed git archive files.
+git-verify-pack \- Validate packed git archive files
.SH "SYNOPSIS"
-git\-verify\-pack [\-v] [\-\-] <pack>\&.idx ...
+\fIgit\-verify\-pack\fR [\-v] [\-\-] <pack>\&.idx ...
.SH "DESCRIPTION"
..
.TH "GIT-VERIFY-TAG" 1 "" "" ""
.SH NAME
-git-verify-tag \- Check the GPG signature of tag.
+git-verify-tag \- Check the GPG signature of tag
.SH "SYNOPSIS"
-git\-verify\-tag <tag>
+\fIgit\-verify\-tag\fR <tag>
.SH "DESCRIPTION"
..
.TH "GIT-WHATCHANGED" 1 "" "" ""
.SH NAME
-git-whatchanged \- Show logs with difference each commit introduces.
+git-whatchanged \- Show logs with difference each commit introduces
.SH "SYNOPSIS"
-git\-whatchanged <option>...
+\fIgit\-whatchanged\fR <option>...
.SH "DESCRIPTION"
-Shows commit logs and diff output each commit introduces\&. The command internally invokes git\-rev\-list piped to git\-diff\-tree, and takes command line options for both of these commands\&.
+Shows commit logs and diff output each commit introduces\&. The command internally invokes \fIgit\-rev\-list\fR piped to \fIgit\-diff\-tree\fR, and takes command line options for both of these commands\&.
This manual page describes only the most frequently used options\&.
.TP
\-\-pretty=<format>
-Controls the output format for the commit logs\&. <format> can be one of raw, medium, short, full, and oneline\&.
+Controls the output format for the commit logs\&. <format> can be one of \fIraw\fR, \fImedium\fR, \fIshort\fR, \fIfull\fR, and \fIoneline\fR\&.
.TP
\-m
.TP
git\-whatchanged \-p v2\&.6\&.12\&.\&. include/scsi drivers/scsi
-Show as patches the commits since version v2\&.6\&.12 that changed any file in the include/scsi or drivers/scsi subdirectories
+Show as patches the commits since version \fIv2\&.6\&.12\fR that changed any file in the include/scsi or drivers/scsi subdirectories
.TP
git\-whatchanged \-\-since="2 weeks ago" -- gitk
-Show the changes during the last two weeks to the file gitk\&. The "\-\-" is necessary to avoid confusion with the branch named gitk
+Show the changes during the last two weeks to the file \fIgitk\fR\&. The "\-\-" is necessary to avoid confusion with the \fIbranch\fR named \fIgitk\fR
.SH "AUTHOR"
.TP
\-\-version
-prints the git suite version that the \fIgit\fR program came from\&.
+Prints the git suite version that the \fIgit\fR program came from\&.
.TP
\-\-help
-prints the synopsis and a list of available commands\&. If a git command is named this option will bring up the man\-page for that command\&.
+Prints the synopsis and a list of the most commonly used commands\&. If a git command is named this option will bring up the man\-page for that command\&. If the option \fI\-\-all\fR or \fI\-a\fR is given then all available commands are printed\&.
.TP
\-\-exec\-path
-path to wherever your core git programs are installed\&. This can also be controlled by setting the GIT_EXEC_PATH environment variable\&. If no path is given \fIgit\fR will print the current setting and then exit\&.
+Path to wherever your core git programs are installed\&. This can also be controlled by setting the GIT_EXEC_PATH environment variable\&. If no path is given \fIgit\fR will print the current setting and then exit\&.
.SH "NOT LEARNING CORE GIT COMMANDS"
Starting from 0\&.99\&.9 (actually mid 0\&.99\&.8\&.GIT), \&.git/config file is used to hold per\-repository configuration options\&. It is a simple text file modelled after \&.ini format familiar to some people\&. Here is an example:
-.IP
+.nf
#
# A '#' or ';' character indicates a comment\&.
#
name = "Junio C Hamano"
email = "junkio@twinsun\&.com"
+.fi
+
Various commands read from the configuration file and adjust their operation accordingly\&.
Here is an ASCII art by Jon Loeliger that illustrates how various pieces fit together\&.
-.IP
+.nf
commit\-tree
commit obj
| Directory |
+\-\-\-\-\-\-\-\-\-\-\-+
+.fi
+
.SS "6) Examining the data"
You can examine such index state with git\-ls\-files \-\-unmerged command\&. An example:
-.IP
+.nf
$ git\-read\-tree \-m $orig HEAD $target
$ git\-ls\-files \-\-unmerged
100644 263414f423d0e4d70dae8fe53fa34614ff3e2860 1 hello\&.c
100644 06fa6a24256dc7e560efa5687fa84b51f0263c3a 2 hello\&.c
100644 cc44c73eb783565da5831b4d820c962954019b69 3 hello\&.c
+.fi
+
Each line of the git\-ls\-files \-\-unmerged output begins with the blob mode bits, blob SHA1, \fIstage number\fR, and the filename\&. The \fIstage number\fR is git's way to say which tree it came from: stage 1 corresponds to $orig tree, stage 2 HEAD tree, and stage3 $target tree\&.
Earlier we said that trivial merges are done inside git\-read\-tree \-m\&. For example, if the file did not change from $orig to HEAD nor $target, or if the file changed from $orig to HEAD and $orig to $target the same way, obviously the final outcome is what is in HEAD\&. What the above example shows is that file hello\&.c was changed from $orig to HEAD and $orig to $target in a different way\&. You could resolve this by running your favorite 3\-way merge program, e\&.g\&. diff3 or merge, on the blob objects from these three stages yourself, like this:
-.IP
+.nf
$ git\-cat\-file blob 263414f\&.\&.\&. >hello\&.c~1
$ git\-cat\-file blob 06fa6a2\&.\&.\&. >hello\&.c~2
$ git\-cat\-file blob cc44c73\&.\&.\&. >hello\&.c~3
$ merge hello\&.c~2 hello\&.c~1 hello\&.c~3
+.fi
+
This would leave the merge result in hello\&.c~2 file, along with conflict markers if there are conflicts\&. After verifying the merge result makes sense, you can tell git what the final merge result for this file is by: