Documentation: spell 'git cmd' without dash throughout
The documentation was quite inconsistent when spelling 'git cmd' if it
only refers to the program, not to some specific invocation syntax:
both 'git-cmd' and 'git cmd' spellings exist.
The current trend goes towards dashless forms, and there is precedent
in 647ac70 (git-svn.txt: stop using dash-form of commands.,
2009-07-07) to actively eliminate the dashed variants.
Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
git-cvsserver, git-upload-pack, git-receive-pack, and
git-upload-archive are concerned, because those really live in the
$PATH.
@ -64,7 +64,7 @@ The values following the equals sign in variable assign are all either
@@ -64,7 +64,7 @@ The values following the equals sign in variable assign are all either
a string, an integer, or a boolean. Boolean values may be given as yes/no,
0/1, true/false or on/off. Case is not significant in boolean values, when
converting value to the canonical form using '--bool' type specifier;
'git-config' will ensure that the output is "true" or "false".
'git config' will ensure that the output is "true" or "false".
String values may be entirely or partially enclosed in double quotes.
You need to enclose variable values in double quotes if you want to
A comma separated list of common whitespace problems to
notice. 'git-diff' will use `color.diff.whitespace` to
highlight them, and 'git-apply --whitespace=error' will
notice. 'git diff' will use `color.diff.whitespace` to
highlight them, and 'git apply --whitespace=error' will
consider them as errors. You can prefix `-` to disable
any of them (e.g. `-trailing-space`):
+
@ -503,7 +503,7 @@ This setting defaults to "refs/notes/commits", and can be overridden by
@@ -503,7 +503,7 @@ This setting defaults to "refs/notes/commits", and can be overridden by
the `GIT_NOTES_REF` environment variable.
add.ignore-errors::
Tells 'git-add' to continue adding files when some files cannot be
Tells 'git add' to continue adding files when some files cannot be
added due to indexing errors. Equivalent to the '--ignore-errors'
option of linkgit:git-add[1].
@ -525,19 +525,19 @@ executed from the top-level directory of a repository, which may
@@ -525,19 +525,19 @@ executed from the top-level directory of a repository, which may
not necessarily be the current directory.
apply.ignorewhitespace::
When set to 'change', tells 'git-apply' to ignore changes in
When set to 'change', tells 'git apply' to ignore changes in
whitespace, in the same way as the '--ignore-space-change'
option.
When set to one of: no, none, never, false tells 'git-apply' to
When set to one of: no, none, never, false tells 'git apply' to
respect all whitespace differences.
See linkgit:git-apply[1].
apply.whitespace::
Tells 'git-apply' how to handle whitespaces, in the same way
Tells 'git apply' how to handle whitespaces, in the same way
as the '--whitespace' option. See linkgit:git-apply[1].
branch.autosetupmerge::
Tells 'git-branch' and 'git-checkout' to setup new branches
Tells 'git branch' and 'git checkout' to setup new branches
so that linkgit:git-pull[1] will appropriately merge from the
starting point branch. Note that even if this option is not set,
this behavior can be chosen per-branch using the `--track`
Pass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).
Pass `-u` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
The proposed commit log message taken from the e-mail
is re-coded into UTF-8 encoding (configuration variable
`i18n.commitencoding` can be used to specify project's
@ -63,7 +63,7 @@ This was optional in prior versions of git, but now it is the
@@ -63,7 +63,7 @@ This was optional in prior versions of git, but now it is the
default. You can use `--no-utf8` to override this.
--no-utf8::
Pass `-n` flag to 'git-mailinfo' (see
Pass `-n` flag to 'git mailinfo' (see
linkgit:git-mailinfo[1]).
-3::
@ -81,7 +81,7 @@ default. You can use `--no-utf8` to override this.
@@ -81,7 +81,7 @@ default. You can use `--no-utf8` to override this.
-p<n>::
--directory=<dir>::
--reject::
These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
These flags are passed to the 'git apply' (see linkgit:git-apply[1])
program that applies
the patch.
@ -121,7 +121,7 @@ default. You can use `--no-utf8` to override this.
@@ -121,7 +121,7 @@ default. You can use `--no-utf8` to override this.
to the screen before exiting. This overrides the
standard message informing you to use `--resolved`
or `--skip` to handle the failure. This is solely
for internal use between 'git-rebase' and 'git-am'.
for internal use between 'git rebase' and 'git am'.
--abort::
Restore the original branch and abort the patching operation.
@ -29,17 +29,17 @@ branches that have different roots, it will refuse to run. In that case,
@@ -29,17 +29,17 @@ branches that have different roots, it will refuse to run. In that case,
edit your <archive/branch> parameters to define clearly the scope of the
import.
'git-archimport' uses `tla` extensively in the background to access the
'git archimport' uses `tla` extensively in the background to access the
Arch repository.
Make sure you have a recent version of `tla` available in the path. `tla` must
know about the repositories you pass to 'git-archimport'.
know about the repositories you pass to 'git archimport'.
For the initial import, 'git-archimport' expects to find itself in an empty
For the initial import, 'git archimport' expects to find itself in an empty
directory. To follow the development of a project that uses Arch, rerun
'git-archimport' with the same parameters as the initial import to perform
'git archimport' with the same parameters as the initial import to perform
incremental imports.
While 'git-archimport' will try to create sensible branch names for the
While 'git archimport' will try to create sensible branch names for the
archives that it imports, it is also possible to specify git branch names
manually. To do so, write a git branch name after each <archive/branch>
parameter, separated by a colon. This way, you can shorten the Arch
@ -21,13 +21,13 @@ structure for the named tree, and writes it out to the standard
@@ -21,13 +21,13 @@ structure for the named tree, and writes it out to the standard
output. If <prefix> is specified it is
prepended to the filenames in the archive.
'git-archive' behaves differently when given a tree ID versus when
'git archive' behaves differently when given a tree ID versus when
given a commit ID or tag ID. In the first case the current time is
used as the modification time of each file in the archive. In the latter
case the commit time as recorded in the referenced commit object is
used instead. Additionally the commit ID is stored in a global
extended pax header if the tar format is used; it can be extracted
using 'git-get-tar-commit-id'. In ZIP files it is stored as a file
using 'git get-tar-commit-id'. In ZIP files it is stored as a file
@ -21,7 +21,7 @@ last modified the line. Optionally, start annotating from the given revision.
@@ -21,7 +21,7 @@ last modified the line. Optionally, start annotating from the given revision.
The command can also limit the range of lines annotated.
The report does not tell you anything about lines which have been deleted or
replaced; you need to use a tool such as 'git-diff' or the "pickaxe"
replaced; you need to use a tool such as 'git diff' or the "pickaxe"
interface briefly mentioned in the following paragraph.
Apart from supporting file annotation, git also supports searching the
file (see `-M`). The first number listed is the score.
This is the number of alphanumeric characters detected
as having been moved between or within files. This must be above
a certain threshold for 'git-blame' to consider those lines
a certain threshold for 'git blame' to consider those lines
of code to have been moved.
-f::
@ -100,7 +100,7 @@ header elements later.
@@ -100,7 +100,7 @@ header elements later.
SPECIFYING RANGES
-----------------
Unlike 'git-blame' and 'git-annotate' in older versions of git, the extent
Unlike 'git blame' and 'git annotate' in older versions of git, the extent
of the annotation can be limited to both line ranges and revision
ranges. When you are interested in finding the origin for
lines 40-60 for file `foo`, you can use the `-L` option like so
@ -118,7 +118,7 @@ which limits the annotation to the body of the `hello` subroutine.
@@ -118,7 +118,7 @@ which limits the annotation to the body of the `hello` subroutine.
When you are not interested in changes older than version
v2.6.18, or changes older than 3 weeks, you can use revision
@ -38,7 +38,7 @@ working tree to it; use "git checkout <newbranch>" to switch to the
@@ -38,7 +38,7 @@ working tree to it; use "git checkout <newbranch>" to switch to the
new branch.
When a local branch is started off a remote branch, git sets up the
branch so that 'git-pull' will appropriately merge from
branch so that 'git pull' will appropriately merge from
the remote branch. This behavior may be changed via the global
`branch.autosetupmerge` configuration flag. That setting can be
overridden by using the `--track` and `--no-track` options.
@ -55,7 +55,7 @@ has a reflog then the reflog will also be deleted.
@@ -55,7 +55,7 @@ has a reflog then the reflog will also be deleted.
Use -r together with -d to delete remote-tracking branches. Note, that it
only makes sense to delete remote-tracking branches if they no longer exist
in the remote repository or if 'git-fetch' was configured not to fetch
in the remote repository or if 'git fetch' was configured not to fetch
them again. See also the 'prune' subcommand of linkgit:git-remote[1] for a
way to clean up all obsolete remote-tracking branches.
@ -21,9 +21,9 @@ Some workflows require that one or more branches of development on one
@@ -21,9 +21,9 @@ Some workflows require that one or more branches of development on one
machine be replicated on another machine, but the two machines cannot
be directly connected, and therefore the interactive git protocols (git,
ssh, rsync, http) cannot be used. This command provides support for
'git-fetch' and 'git-pull' to operate by packaging objects and references
'git fetch' and 'git pull' to operate by packaging objects and references
in an archive at the originating machine, then importing those into
another repository using 'git-fetch' and 'git-pull'
another repository using 'git fetch' and 'git pull'
after moving the archive by some means (e.g., by sneakernet). As no
direct connection between the repositories exists, the user must specify a
basis for the bundle that is held by the destination repository: the
@ -60,7 +60,7 @@ reference name expressions (see linkgit:git-rev-parse[1]):
@@ -60,7 +60,7 @@ reference name expressions (see linkgit:git-rev-parse[1]):
. A colon `:` is used as in `srcref:dstref` to mean "use srcref\'s
value and store it in dstref" in fetch and push operations.
It may also be used to select a specific object such as with
@ -102,7 +102,7 @@ Using `--` is probably a good policy in scripts.
@@ -102,7 +102,7 @@ Using `--` is probably a good policy in scripts.
Using --temp or --stage=all
---------------------------
When `--temp` is used (or implied by `--stage=all`)
'git-checkout-index' will create a temporary file for each index
'git checkout-index' will create a temporary file for each index
entry being checked out. The index will not be updated with stat
information. These options can be useful if the caller needs all
stages of all unmerged entries so that the unmerged files can be
@ -147,9 +147,9 @@ To update and refresh only the files already checked out::
@@ -147,9 +147,9 @@ To update and refresh only the files already checked out::
@ -70,7 +70,7 @@ is taken from the configuration items user.name and user.email, or, if not
@@ -70,7 +70,7 @@ is taken from the configuration items user.name and user.email, or, if not
present, system user name and fully qualified hostname.
A commit comment is read from stdin. If a changelog
entry is not provided via "<" redirection, 'git-commit-tree' will just wait
entry is not provided via "<" redirection, 'git commit-tree' will just wait
@ -20,11 +20,11 @@ with a log message from the user describing the changes.
@@ -20,11 +20,11 @@ with a log message from the user describing the changes.
The content to be added can be specified in several ways:
1. by using 'git-add' to incrementally "add" changes to the
1. by using 'git add' to incrementally "add" changes to the
index before using the 'commit' command (Note: even modified
files must be "added");
2. by using 'git-rm' to remove files from the working tree
2. by using 'git rm' to remove files from the working tree
and the index, again before using the 'commit' command;
3. by listing files as arguments to the 'commit' command, in which
@ -40,14 +40,14 @@ The content to be added can be specified in several ways:
@@ -40,14 +40,14 @@ The content to be added can be specified in several ways:
5. by using the --interactive switch with the 'commit' command to decide one
by one which files should be part of the commit, before finalizing the
operation. Currently, this is done by invoking 'git-add --interactive'.
operation. Currently, this is done by invoking 'git add --interactive'.
The `--dry-run` option can be used to obtain a
summary of what is included by any of the above for the next
commit by giving the same set of parameters (options and paths).
If you make a commit and then find a mistake immediately after
that, you can recover from it with 'git-reset'.
that, you can recover from it with 'git reset'.
OPTIONS
@ -184,7 +184,7 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
@@ -184,7 +184,7 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
Make a commit only from the paths specified on the
command line, disregarding any contents that have been
staged so far. This is the default mode of operation of
'git-commit' if any paths are given on the command line,
'git commit' if any paths are given on the command line,
in which case this option can be omitted.
If this option is specified together with '--amend', then
no paths need to be specified, which can be used to amend
@ -38,7 +38,7 @@ you want to handle the lines that do *not* match the regex, just
@@ -38,7 +38,7 @@ you want to handle the lines that do *not* match the regex, just
prepend a single exclamation mark in front (see also <<EXAMPLES>>).
The type specifier can be either '--int' or '--bool', which will make
'git-config' ensure that the variable(s) are of the given type and
'git config' ensure that the variable(s) are of the given type and
convert the value to the canonical form (simple decimal number for int,
a "true" or "false" string for bool). If no type specifier is passed,
no checks or transformations are performed on the value.
@ -124,16 +124,16 @@ See also <<FILES>>.
@@ -124,16 +124,16 @@ See also <<FILES>>.
List all variables set in config file.
--bool::
'git-config' will ensure that the output is "true" or "false"
'git config' will ensure that the output is "true" or "false"
--int::
'git-config' will ensure that the output is a simple
'git config' will ensure that the output is a simple
decimal number. An optional value suffix of 'k', 'm', or 'g'
in the config file will cause the value to be multiplied
by 1024, 1048576, or 1073741824 prior to output.
--bool-or-int::
'git-config' will ensure that the output matches the format of
'git config' will ensure that the output matches the format of
Use this option if you want to import into a different
branch.
+
@ -145,17 +145,17 @@ This option can be used several times to provide several detection regexes.
@@ -145,17 +145,17 @@ This option can be used several times to provide several detection regexes.
---------
+
'git-cvsimport' will make it appear as those authors had
'git cvsimport' will make it appear as those authors had
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
all along.
+
For convenience, this data is saved to `$GIT_DIR/cvs-authors`
each time the '-A' option is provided and read from that same
file each time 'git-cvsimport' is run.
file each time 'git cvsimport' is run.
+
It is not recommended to use this feature if you intend to
To set up 'git-daemon' as an inetd service that handles any
'git daemon' as inetd server::
To set up 'git daemon' as an inetd service that handles any
repository under the whitelisted set of directories, /pub/foo
and /pub/bar, place an entry like the following into
/etc/inetd all on one line:
@ -217,8 +217,8 @@ git 9418/tcp # Git Version Control System
@@ -217,8 +217,8 @@ git 9418/tcp # Git Version Control System
------------------------------------------------
'git-daemon' as inetd server for virtual hosts::
To set up 'git-daemon' as an inetd service that handles
'git daemon' as inetd server for virtual hosts::
To set up 'git daemon' as an inetd service that handles
repositories for different virtual hosts, `www.example.com`
and `www.example.org`, place an entry like the following into
`/etc/inetd` all on one line:
@ -240,8 +240,8 @@ clients, a symlink from `/software` into the appropriate
@@ -240,8 +240,8 @@ clients, a symlink from `/software` into the appropriate
default repository could be made as well.
'git-daemon' as regular daemon for virtual hosts::
To set up 'git-daemon' as a regular, non-inetd service that
'git daemon' as regular daemon for virtual hosts::
To set up 'git daemon' as a regular, non-inetd service that
handles repositories for multiple virtual hosts based on
their IP addresses, start the daemon like this:
+
@ -258,7 +258,7 @@ Repositories can still be accessed by hostname though, assuming
@@ -258,7 +258,7 @@ Repositories can still be accessed by hostname though, assuming
they correspond to these IP addresses.
selectively enable/disable services per repository::
To enable 'git-archive --remote' and disable 'git-fetch' against
To enable 'git archive --remote' and disable 'git fetch' against
a repository, have the following in the configuration file in the
repository (that is the file 'config' next to 'HEAD', 'refs' and
'objects').
@ -272,7 +272,7 @@ selectively enable/disable services per repository::
@@ -272,7 +272,7 @@ selectively enable/disable services per repository::
ENVIRONMENT
-----------
'git-daemon' will set REMOTE_ADDR to the IP address of the client
'git daemon' will set REMOTE_ADDR to the IP address of the client
that connected to it, if the IP address is available. REMOTE_ADDR will
be available in the environment of hooks called when
@ -106,7 +106,7 @@ of commits which would be displayed by "git log v1.0.4..parent".
@@ -106,7 +106,7 @@ of commits which would be displayed by "git log v1.0.4..parent".
The hash suffix is "-g" + 7-char abbreviation for the tip commit
of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
Doing a 'git-describe' on a tag-name will just show the tag name:
Doing a 'git describe' on a tag-name will just show the tag name:
[torvalds@g5 git]$ git describe v1.0.4
v1.0.4
@ -136,13 +136,13 @@ be sufficient to disambiguate these commits.
@@ -136,13 +136,13 @@ be sufficient to disambiguate these commits.
SEARCH STRATEGY
---------------
For each committish supplied, 'git-describe' will first look for
For each committish supplied, 'git describe' will first look for
a tag which tags exactly that commit. Annotated tags will always
be preferred over lightweight tags, and tags with newer dates will
always be preferred over tags with older dates. If an exact match
is found, its name will be output and searching will stop.
If an exact match was not found, 'git-describe' will walk back
If an exact match was not found, 'git describe' will walk back
through the commit history to locate an ancestor commit which
has been tagged. The ancestor's tag will be output along with an
show me the differences between HEAD and the current index
contents (the ones I'd write using 'git-write-tree')
contents (the ones I'd write using 'git write-tree')
For example, let's say that you have worked on your working directory, updated
some files in the index and are ready to commit. You want to see exactly
@ -60,7 +60,7 @@ object and compare it that way, and to do that, you just do
@@ -60,7 +60,7 @@ object and compare it that way, and to do that, you just do
Example: let's say I had renamed `commit.c` to `git-commit.c`, and I had
done an `update-index` to make that effective in the index file.
`git diff-files` wouldn't show anything at all, since the index file
matches my working directory. But doing a 'git-diff-index' does:
matches my working directory. But doing a 'git diff-index' does:
torvalds@ppc970:~/git> git diff-index --cached HEAD
@ -69,10 +69,10 @@ matches my working directory. But doing a 'git-diff-index' does:
@@ -69,10 +69,10 @@ matches my working directory. But doing a 'git-diff-index' does:
You can see easily that the above is a rename.
In fact, `git diff-index --cached` *should* always be entirely equivalent to
actually doing a 'git-write-tree' and comparing that. Except this one is much
actually doing a 'git write-tree' and comparing that. Except this one is much
nicer for the case where you just want to check where you are.
So doing a 'git-diff-index --cached' is basically very useful when you are
So doing a `git diff-index --cached` is basically very useful when you are
asking yourself "what have I already marked for being committed, and
The "non-cached" mode takes a different approach, and is potentially
the more useful of the two in that what it does can't be emulated with
a 'git-write-tree' + 'git-diff-tree'. Thus that's the default mode.
a 'git write-tree' + 'git diff-tree'. Thus that's the default mode.
The non-cached version asks the question:
show me the differences between HEAD and the currently checked out
tree - index contents _and_ files that aren't up-to-date
which is obviously a very useful question too, since that tells you what
you *could* commit. Again, the output matches the 'git-diff-tree -r'
you *could* commit. Again, the output matches the 'git diff-tree -r'
output to a tee, but with a twist.
The twist is that if some file doesn't match the index, we don't have
a backing store thing for it, and we use the magic "all-zero" sha1 to
show that. So let's say that you have edited `kernel/sched.c`, but
have not actually done a 'git-update-index' on it yet - there is no
have not actually done a 'git update-index' on it yet - there is no
"object" associated with the new state, and you get:
torvalds@ppc970:~/v2.6/linux> git diff-index HEAD
@ -104,11 +104,11 @@ not up-to-date and may contain new stuff. The all-zero sha1 means that to
@@ -104,11 +104,11 @@ not up-to-date and may contain new stuff. The all-zero sha1 means that to
get the real diff, you need to look at the object in the working directory
directly rather than do an object-to-object diff.
NOTE: As with other commands of this type, 'git-diff-index' does not
NOTE: As with other commands of this type, 'git diff-index' does not
actually look at the contents of the file at all. So maybe
`kernel/sched.c` hasn't actually changed, and it's just that you
touched it. In either case, it's a note that you need to
'git-update-index' it to make the index be in sync.
'git update-index' it to make the index be in sync.
NOTE: You can have a mixture of files show up as "has been updated"
and "is still dirty in the working directory" together. You can always
@ -20,7 +20,7 @@ Compares the content and mode of the blobs found via two tree objects.
@@ -20,7 +20,7 @@ Compares the content and mode of the blobs found via two tree objects.
If there is only one <tree-ish> given, the commit is compared with its parents
(see --stdin below).
Note that 'git-diff-tree' can use the tree encapsulated in a commit object.
Note that 'git diff-tree' can use the tree encapsulated in a commit object.
OPTIONS
-------
@ -67,25 +67,25 @@ The following flags further affect the behavior when comparing
@@ -67,25 +67,25 @@ The following flags further affect the behavior when comparing
commits (but not trees).
-m::
By default, 'git-diff-tree --stdin' does not show
By default, 'git diff-tree --stdin' does not show
differences for merge commits. With this flag, it shows
differences to that commit from all of its parents. See
also '-c'.
-s::
By default, 'git-diff-tree --stdin' shows differences,
By default, 'git diff-tree --stdin' shows differences,
either in machine-readable form (without '-p') or in patch
form (with '-p'). This output can be suppressed. It is
only useful with '-v' flag.
-v::
This flag causes 'git-diff-tree --stdin' to also show
This flag causes 'git diff-tree --stdin' to also show
the commit message before the differences.
include::pretty-options.txt[]
--no-commit-id::
'git-diff-tree' outputs a line with the commit ID when
'git diff-tree' outputs a line with the commit ID when
applicable. This flag suppressed the commit ID output.
will use the configuration variable `diff.tool`. If the
configuration variable `diff.tool` is not set, 'git-difftool'
configuration variable `diff.tool` is not set, 'git difftool'
will pick a suitable default.
+
You can explicitly provide a full path to the tool by setting the
configuration variable `difftool.<tool>.path`. For example, you
can configure the absolute path to kdiff3 by setting
`difftool.kdiff3.path`. Otherwise, 'git-difftool' assumes the
`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the
tool is available in PATH.
+
Instead of running one of the known diff tools,
'git-difftool' can be customized to run an alternative program
'git difftool' can be customized to run an alternative program
by specifying the command line to invoke in a configuration
variable `difftool.<tool>.cmd`.
+
When 'git-difftool' is invoked with this tool (either through the
When 'git difftool' is invoked with this tool (either through the
`-t` or `--tool` option or the `diff.tool` configuration variable)
the configured command line will be invoked with the following
variables available: `$LOCAL` is set to the name of the temporary
@ -62,7 +62,7 @@ See linkgit:git-diff[1] for the full list of supported options.
@@ -62,7 +62,7 @@ See linkgit:git-diff[1] for the full list of supported options.
CONFIG VARIABLES
----------------
'git-difftool' falls back to 'git-mergetool' config variables when the
'git difftool' falls back to 'git mergetool' config variables when the
This program is usually not what the end user wants to run directly.
Most end users want to use one of the existing frontend programs,
which parses a specific type of foreign source and feeds the contents
stored there to 'git-fast-import'.
stored there to 'git fast-import'.
fast-import reads a mixed command/data stream from standard input and
writes one or more packfiles directly into the current repository.
@ -24,7 +24,7 @@ updated branch and tag refs, fully updating the current repository
@@ -24,7 +24,7 @@ updated branch and tag refs, fully updating the current repository
with the newly imported data.
The fast-import backend itself can import into an empty repository (one that
has already been initialized by 'git-init') or incrementally
has already been initialized by 'git init') or incrementally
update an existing populated repository. Whether or not incremental
imports are supported from a particular foreign source depends on
This information may be useful after importing projects
whose total object set exceeds the 4 GiB packfile limit,
as these commits can be used as edge points during calls
to 'git-pack-objects'.
to 'git pack-objects'.
--quiet::
Disable all non-fatal output, making fast-import silent when it
@ -124,9 +124,9 @@ an ideal situation, given that most conversion tools are throw-away
@@ -124,9 +124,9 @@ an ideal situation, given that most conversion tools are throw-away
Parallel Operation
------------------
Like 'git-push' or 'git-fetch', imports handled by fast-import are safe to
Like 'git push' or 'git fetch', imports handled by fast-import are safe to
run alongside parallel `git repack -a -d` or `git gc` invocations,
or any other Git operation (including 'git-prune', as loose objects
or any other Git operation (including 'git prune', as loose objects
are never used by fast-import).
fast-import does not lock the branch or tag refs it is actively importing.
@ -220,7 +220,7 @@ variation in formatting will cause fast-import to reject the value.
@@ -220,7 +220,7 @@ variation in formatting will cause fast-import to reject the value.
+
An example value is ``Tue Feb 6 11:22:18 2007 -0500''. The Git
parser is accurate, but a little on the lenient side. It is the
same parser used by 'git-am' when applying patches
same parser used by 'git am' when applying patches
received from email.
+
Some malformed strings may be accepted as valid dates. In some of
This particular format is supplied as its short to implement and
may be useful to a process that wants to create a new commit
right now, without needing to use a working directory or
'git-update-index'.
'git update-index'.
+
If separate `author` and `committer` commands are used in a `commit`
the timestamps may not match, as the system clock will be polled
@ -690,7 +690,7 @@ recommended, as the frontend does not (easily) have access to the
@@ -690,7 +690,7 @@ recommended, as the frontend does not (easily) have access to the
complete set of bytes which normally goes into such a signature.
If signing is required, create lightweight tags from within fast-import with
`reset`, then create the annotated versions of those tags offline
with the standard 'git-tag' process.
with the standard 'git tag' process.
`reset`
~~~~~~~
@ -991,7 +991,7 @@ is not `refs/heads/TAG_FIXUP`).
@@ -991,7 +991,7 @@ is not `refs/heads/TAG_FIXUP`).
When committing fixups, consider using `merge` to connect the
commit(s) which are supplying file revisions to the fixup branch.
Doing so will allow tools such as 'git-blame' to track
Doing so will allow tools such as 'git blame' to track
through the real commit history and properly annotate the source
files.
@ -1020,7 +1020,7 @@ Repacking Historical Data
@@ -1020,7 +1020,7 @@ Repacking Historical Data
~~~~~~~~~~~~~~~~~~~~~~~~~
If you are repacking very old imported data (e.g. older than the
last year), consider expending some extra CPU time and supplying
\--window=50 (or higher) when you run 'git-repack'.
\--window=50 (or higher) when you run 'git repack'.
This will take longer, but will also produce a smaller packfile.
You only need to expend the effort once, and everyone using your
If this filter is specified, it will be called instead of the
'git-commit-tree' command, with arguments of the form
'git commit-tree' command, with arguments of the form
"<TREE_ID> [-p <PARENT_COMMIT_ID>]..." and the log message on
stdin. The commit id is expected on stdout.
+
@ -127,7 +127,7 @@ have all of them as parents.
@@ -127,7 +127,7 @@ have all of them as parents.
You can use the 'map' convenience function in this filter, and other
convenience functions, too. For example, calling 'skip_commit "$@"'
will leave out the current commit (but not its changes! If you want
that, use 'git-rebase' instead).
that, use 'git rebase' instead).
+
You can also use the `git_commit_non_empty_tree "$@"` instead of
`git commit-tree "$@"` if you don't wish to keep commits with a single parent
@ -196,15 +196,15 @@ the nearest ancestor that was not excluded.
@@ -196,15 +196,15 @@ the nearest ancestor that was not excluded.
-f::
--force::
'git-filter-branch' refuses to start with an existing temporary
'git filter-branch' refuses to start with an existing temporary
directory or when there are already refs starting with
'refs/original/', unless forced.
<rev-list options>...::
Arguments for 'git-rev-list'. All positive refs included by
Arguments for 'git rev-list'. All positive refs included by
these options are rewritten. You may also specify options
such as '--all', but you must use '--' to separate them from
the 'git-filter-branch' options.
the 'git filter-branch' options.
Examples
@ -221,7 +221,7 @@ However, if the file is absent from the tree of some commit,
@@ -221,7 +221,7 @@ However, if the file is absent from the tree of some commit,
a simple `rm filename` will fail for that tree and commit.
Thus you may instead want to use `rm -f filename` as the script.
Using `\--index-filter` with 'git-rm' yields a significantly faster
Using `\--index-filter` with 'git rm' yields a significantly faster
version. Like with using `rm filename`, `git rm --cached filename`
will fail if the file is absent from the tree of a commit. If you
want to "completely forget" a file, it does not matter when it entered
@ -303,7 +303,7 @@ and all children of the merge will become merge commits with P1,P2
@@ -303,7 +303,7 @@ and all children of the merge will become merge commits with P1,P2
as their parents instead of the merge commit.
You can rewrite the commit log messages using `--msg-filter`. For
example, 'git-svn-id' strings in a repository created by 'git-svn' can
example, 'git svn-id' strings in a repository created by 'git svn' can
Usually 'git-gc' runs very quickly while providing good disk
Usually 'git gc' runs very quickly while providing good disk
space utilization and performance. This option will cause
'git-gc' to more aggressively optimize the repository at the expense
'git gc' to more aggressively optimize the repository at the expense
of taking much more time. The effects of this optimization are
persistent, so this option only needs to be used occasionally; every
few hundred changesets or so.
--auto::
With this option, 'git-gc' checks whether any housekeeping is
With this option, 'git gc' checks whether any housekeeping is
required; if not, it exits without performing any work.
Some git commands run `git gc --auto` after performing
operations that could create many loose objects.
@ -50,13 +50,13 @@ Housekeeping is required if there are too many loose objects or
@@ -50,13 +50,13 @@ Housekeeping is required if there are too many loose objects or
too many packs in the repository. If the number of loose objects
exceeds the value of the `gc.auto` configuration variable, then
all loose objects are combined into a single pack using
`git-repack -d -l`. Setting the value of `gc.auto` to 0
`git repack -d -l`. Setting the value of `gc.auto` to 0
disables automatic packing of loose objects.
+
If the number of packs exceeds the value of `gc.autopacklimit`,
then existing packs (except those marked with a `.keep` file)
are consolidated into a single pack by using the `-A` option of
'git-repack'. Setting `gc.autopacklimit` to 0 disables
'git repack'. Setting `gc.autopacklimit` to 0 disables
automatic consolidation of packs.
--prune=<date>::
@ -97,7 +97,7 @@ how long records of conflicted merge you have not resolved are
@@ -97,7 +97,7 @@ how long records of conflicted merge you have not resolved are
kept. This defaults to 15 days.
The optional configuration variable 'gc.packrefs' determines if
'git-gc' runs 'git-pack-refs'. This can be set to "nobare" to enable
'git gc' runs 'git pack-refs'. This can be set to "nobare" to enable
it within all non-bare repos or it can be set to a boolean value.
This defaults to true.
@ -116,10 +116,10 @@ default is "2 weeks ago".
@@ -116,10 +116,10 @@ default is "2 weeks ago".
Notes
-----
'git-gc' tries very hard to be safe about the garbage it collects. In
'git gc' tries very hard to be safe about the garbage it collects. In
particular, it will keep not only objects referenced by your current set
of branches and tags, but also objects referenced by the index, remote
tracking branches, refs saved by 'git-filter-branch' in
tracking branches, refs saved by 'git filter-branch' in
refs/original/, or reflogs (which may reference commits in branches
@ -18,7 +18,7 @@ Computes the object ID value for an object with specified type
@@ -18,7 +18,7 @@ Computes the object ID value for an object with specified type
with the contents of the named file (which can be outside of the
work tree), and optionally writes the resulting object into the
object database. Reports its object ID to its standard output.
This is used by 'git-cvsimport' to update the index
This is used by 'git cvsimport' to update the index
without modifying files in the work tree. When <type> is not
@ -8,7 +8,7 @@ git-http-backend - Server side implementation of Git over HTTP
@@ -8,7 +8,7 @@ git-http-backend - Server side implementation of Git over HTTP
SYNOPSIS
--------
[verse]
'git-http-backend'
'git http-backend'
DESCRIPTION
-----------
@ -19,10 +19,10 @@ and the backwards-compatible dumb HTTP protocol, as well as clients
@@ -19,10 +19,10 @@ and the backwards-compatible dumb HTTP protocol, as well as clients
pushing using the smart HTTP protocol.
By default, only the `upload-pack` service is enabled, which serves
'git-fetch-pack' and 'git-ls-remote' clients, which are invoked from
'git-fetch', 'git-pull', and 'git-clone'. If the client is authenticated,
the `receive-pack` service is enabled, which serves 'git-send-pack'
clients, which is invoked from 'git-push'.
'git fetch-pack' and 'git ls-remote' clients, which are invoked from
'git fetch', 'git pull', and 'git clone'. If the client is authenticated,
the `receive-pack` service is enabled, which serves 'git send-pack'
To determine the location of the repository on disk, 'git-http-backend'
To determine the location of the repository on disk, 'git http-backend'
concatenates the environment variables PATH_INFO, which is set
automatically by the web server, and GIT_PROJECT_ROOT, which must be set
manually in the web server configuration. If GIT_PROJECT_ROOT is not
set, 'git-http-backend' reads PATH_TRANSLATED, which is also set
set, 'git http-backend' reads PATH_TRANSLATED, which is also set
automatically by the web server.
EXAMPLES
@ -98,7 +98,7 @@ directive around the repository, or one of its parent directories:
@@ -98,7 +98,7 @@ directive around the repository, or one of its parent directories:
Before moving the index into its final destination
create an empty .keep file for the associated pack file.
This option is usually necessary with --stdin to prevent a
simultaneous 'git-repack' process from deleting
simultaneous 'git repack' process from deleting
the newly constructed pack and index before refs can be
updated to use objects contained in the pack.
@ -86,7 +86,7 @@ Once the index has been created, the list of object names is sorted
@@ -86,7 +86,7 @@ Once the index has been created, the list of object names is sorted
and the SHA1 hash of that list is printed to stdout. If --stdin was
also used then this is prefixed by either "pack\t", or "keep\t" if a
new .keep file was successfully created. This is useful to remove a
.keep file used as a lock to prevent the race with 'git-repack'
.keep file used as a lock to prevent the race with 'git repack'
@ -95,11 +95,11 @@ If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
@@ -95,11 +95,11 @@ If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
environment variable then the sha1 directories are created underneath -
otherwise the default `$GIT_DIR/objects` directory is used.
Running 'git-init' in an existing repository is safe. It will not overwrite
things that are already there. The primary reason for rerunning 'git-init'
Running 'git init' in an existing repository is safe. It will not overwrite
things that are already there. The primary reason for rerunning 'git init'
is to pick up newly added templates.
Note that 'git-init' is the same as 'git-init-db'. The command
Note that 'git init' is the same as 'git init-db'. The command
was primarily meant to initialize the object database, but over
time it has become responsible for setting up the other aspects
of the repository, such as installing the default hooks and
'git-ls-files' can use a list of "exclude patterns" when
'git ls-files' can use a list of "exclude patterns" when
traversing the directory tree and finding files to show when the
flags --others or --ignored are specified. linkgit:gitignore[5]
specifies the format of exclude patterns.
@ -178,7 +178,7 @@ These exclude patterns come from these places, in order:
@@ -178,7 +178,7 @@ These exclude patterns come from these places, in order:
in the same order they appear in the file.
3. command line flag --exclude-per-directory=<name> specifies
a name of the file in each directory 'git-ls-files'
a name of the file in each directory 'git ls-files'
examines, normally `.gitignore`. Files in deeper
directories take precedence. Patterns are ordered in the
@ -8,12 +8,12 @@ git-merge-one-file - The standard helper program to use with git-merge-index
@@ -8,12 +8,12 @@ git-merge-one-file - The standard helper program to use with git-merge-index
SYNOPSIS
--------
'git-merge-one-file'
'git merge-one-file'
DESCRIPTION
-----------
This is the standard helper program to use with 'git-merge-index'
to resolve a merge after the trivial merge done with 'git-read-tree -m'.
This is the standard helper program to use with 'git merge-index'
to resolve a merge after the trivial merge done with 'git read-tree -m'.
@ -22,7 +22,7 @@ The second syntax (<msg> `HEAD` <commit>...) is supported for
@@ -22,7 +22,7 @@ The second syntax (<msg> `HEAD` <commit>...) is supported for
historical reasons. Do not use it from the command line or in
new scripts. It is the same as `git merge -m <msg> <commit>...`.
*Warning*: Running 'git-merge' with uncommitted changes is
*Warning*: Running 'git merge' with uncommitted changes is
discouraged: while possible, it leaves you in a state that is hard to
Finds symbolic names suitable for human digestion for revisions given in any
format parsable by 'git-rev-parse'.
format parsable by 'git rev-parse'.
OPTIONS
@ -55,7 +55,7 @@ wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
@@ -55,7 +55,7 @@ wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
Of course, you look into the commit, but that only tells you what happened, but
@ -32,7 +32,7 @@ Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
@@ -32,7 +32,7 @@ Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
enables git to read from such an archive.
The 'git-unpack-objects' command can read the packed archive and
The 'git unpack-objects' command can read the packed archive and
expand the objects contained in the pack into "one-file
one-object" format; this is typically done by the smart-pull
commands when a pack is created on-the-fly for efficient network
@ -8,21 +8,21 @@ git-prune - Prune all unreachable objects from the object database
@@ -8,21 +8,21 @@ git-prune - Prune all unreachable objects from the object database
@ -112,7 +112,7 @@ nor in any Push line of the corresponding remotes file---see below).
@@ -112,7 +112,7 @@ nor in any Push line of the corresponding remotes file---see below).
--repo=<repository>::
This option is only relevant if no <repository> argument is
passed in the invocation. In this case, 'git-push' derives the
passed in the invocation. In this case, 'git push' derives the
remote name from the current branch: If it tracks a remote
branch, then that remote repository is pushed to. Otherwise,
the name "origin" is used. For this latter case, this option
@ -25,8 +25,8 @@ fast-forward (i.e. 2-way) merge, or a 3-way merge, with the `-m`
@@ -25,8 +25,8 @@ fast-forward (i.e. 2-way) merge, or a 3-way merge, with the `-m`
flag. When used with `-m`, the `-u` flag causes it to also update
the files in the work tree with the result of the merge.
Trivial merges are done by 'git-read-tree' itself. Only conflicting paths
will be in unmerged state when 'git-read-tree' returns.
Trivial merges are done by 'git read-tree' itself. Only conflicting paths
will be in unmerged state when 'git read-tree' returns.
If only 1 tree is specified, 'git-read-tree' operates as if the user did not
If only 1 tree is specified, 'git read-tree' operates as if the user did not
specify `-m`, except that if the original index has an entry for a
given pathname, and the contents of the path matches with the tree
being read, the stat info from the index is used. (In other words, the
index's stat()s take precedence over the merged tree's).
That means that if you do a `git read-tree -m <newtree>` followed by a
`git checkout-index -f -u -a`, the 'git-checkout-index' only checks out
`git checkout-index -f -u -a`, the 'git checkout-index' only checks out
the stuff that really changed.
This is used to avoid unnecessary false hits when 'git-diff-files' is
run after 'git-read-tree'.
This is used to avoid unnecessary false hits when 'git diff-files' is
run after 'git read-tree'.
Two Tree Merge
@ -146,7 +146,7 @@ is the head commit of the current repository, and $M is the head
@@ -146,7 +146,7 @@ is the head commit of the current repository, and $M is the head
of a foreign tree, which is simply ahead of $H (i.e. we are in a
fast-forward situation).
When two trees are specified, the user is telling 'git-read-tree'
When two trees are specified, the user is telling 'git read-tree'
the following:
1. The current index and work tree is derived from $H, but
@ -199,10 +199,10 @@ Here are the "carry forward" rules:
@@ -199,10 +199,10 @@ Here are the "carry forward" rules:
In all "keep index" cases, the index entry stays as in the
original index file. If the entry were not up to date,
'git-read-tree' keeps the copy in the work tree intact when
'git read-tree' keeps the copy in the work tree intact when
operating under the -u flag.
When this form of 'git-read-tree' returns successfully, you can
When this form of 'git read-tree' returns successfully, you can
see what "local changes" you made are carried forward by running
`git diff-index --cached $M`. Note that this does not
necessarily match `git diff-index --cached $H` would have
@ -225,7 +225,7 @@ of the path is kept as long as $H and $M are the same.
@@ -225,7 +225,7 @@ of the path is kept as long as $H and $M are the same.
Each "index" entry has two bits worth of "stage" state. stage 0 is the
normal one, and is the only one you'd see in any kind of normal use.
However, when you do 'git-read-tree' with three trees, the "stage"
However, when you do 'git read-tree' with three trees, the "stage"
starts out at 1.
This means that you can do
@ -241,7 +241,7 @@ branch into the current branch, we use the common ancestor tree
@@ -241,7 +241,7 @@ branch into the current branch, we use the common ancestor tree
as <tree1>, the current branch head as <tree2>, and the other
branch head as <tree3>.
Furthermore, 'git-read-tree' has special-case logic that says: if you see
Furthermore, 'git read-tree' has special-case logic that says: if you see
a file that matches in all respects in the following states, it
"collapses" back to "stage0":
@ -257,7 +257,7 @@ a file that matches in all respects in the following states, it
@@ -257,7 +257,7 @@ a file that matches in all respects in the following states, it
- stage 1 and stage 3 are the same and stage 2 is different take
stage 2 (we did something while they did nothing)
The 'git-write-tree' command refuses to write a nonsensical tree, and it
The 'git write-tree' command refuses to write a nonsensical tree, and it
will complain about unmerged entries if it sees a single entry that is not
stage 0.
@ -273,7 +273,7 @@ start a 3-way merge with an index file that is already
@@ -273,7 +273,7 @@ start a 3-way merge with an index file that is already
populated. Here is an outline of how the algorithm works:
- if a file exists in identical format in all three trees, it will
automatically collapse to "merged" state by 'git-read-tree'.
automatically collapse to "merged" state by 'git read-tree'.
- a file that has _any_ difference what-so-ever in the three trees
will stay as separate entries in the index. It's up to "porcelain
@ -297,8 +297,8 @@ populated. Here is an outline of how the algorithm works:
@@ -297,8 +297,8 @@ populated. Here is an outline of how the algorithm works:
matching "stage1" entry if it exists too. .. all the normal
trivial rules ..
You would normally use 'git-merge-index' with supplied
'git-merge-one-file' to do this last step. The script updates
You would normally use 'git merge-index' with supplied
'git merge-one-file' to do this last step. The script updates
the files in the working tree as it merges each path and at the
You do random edits, without running 'git-update-index'. And then
You do random edits, without running 'git update-index'. And then
you notice that the tip of your "upstream" tree has advanced
since you pulled from him:
@ -346,14 +346,14 @@ your work-in-progress changes, and your work tree would be
@@ -346,14 +346,14 @@ your work-in-progress changes, and your work tree would be
updated to the result of the merge.
However, if you have local changes in the working tree that
would be overwritten by this merge, 'git-read-tree' will refuse
would be overwritten by this merge, 'git read-tree' will refuse
to run to prevent your changes from being lost.
In other words, there is no need to worry about what exists only
in the working tree. When you have local changes in a part of
the project that is not involved in the merge, your changes do
not interfere with the merge, and are kept intact. When they
*do* interfere, the merge does not even start ('git-read-tree'
*do* interfere, the merge does not even start ('git read-tree'
complains loudly and fails without modifying anything). In such
a case, you can simply continue doing what you were in the
middle of doing, and when your working tree is ready (i.e. you
If <branch> is specified, 'git-rebase' will perform an automatic
If <branch> is specified, 'git rebase' will perform an automatic
`git checkout <branch>` before doing anything else. Otherwise
it remains on the current branch.
@ -170,8 +170,8 @@ This is useful if F and G were flawed in some way, or should not be
@@ -170,8 +170,8 @@ This is useful if F and G were flawed in some way, or should not be
part of topicA. Note that the argument to --onto and the <upstream>
parameter can be any valid commit-ish.
In case of conflict, 'git-rebase' will stop at the first problematic commit
and leave conflict markers in the tree. You can use 'git-diff' to locate
In case of conflict, 'git rebase' will stop at the first problematic commit
and leave conflict markers in the tree. You can use 'git diff' to locate
the markers (<<<<<<) and make edits to resolve the conflict. For each
file you edit, you need to tell git that the conflict has been resolved,
typically this would be done with
@ -187,7 +187,7 @@ desired resolution, you can continue the rebasing process with
@@ -187,7 +187,7 @@ desired resolution, you can continue the rebasing process with
git rebase --continue
Alternatively, you can undo the 'git-rebase' with
Alternatively, you can undo the 'git rebase' with
git rebase --abort
@ -238,10 +238,10 @@ other words, the sides are swapped.
@@ -238,10 +238,10 @@ other words, the sides are swapped.
-s <strategy>::
--strategy=<strategy>::
Use the given merge strategy.
If there is no `-s` option 'git-merge-recursive' is used
If there is no `-s` option 'git merge-recursive' is used
instead. This implies --merge.
+
Because 'git-rebase' replays each commit from the working branch
Because 'git rebase' replays each commit from the working branch
on top of the <upstream> branch using the given strategy, using
the 'ours' strategy simply discards all patches from the <branch>,
which makes little sense.
@ -280,13 +280,13 @@ which makes little sense.
@@ -280,13 +280,13 @@ which makes little sense.
--ignore-whitespace::
--whitespace=<option>::
These flag are passed to the 'git-apply' program
These flag are passed to the 'git apply' program
(see linkgit:git-apply[1]) that applies the patch.
Incompatible with the --interactive option.
--committer-date-is-author-date::
--ignore-date::
These flags are passed to 'git-am' to easily change the dates
These flags are passed to 'git am' to easily change the dates
You should understand the implications of using 'git-rebase' on a
You should understand the implications of using 'git rebase' on a
repository that you share. See also RECOVERING FROM UPSTREAM REBASE
below.
@ -369,12 +369,12 @@ pick fa1afe1 The oneline of the next commit
@@ -369,12 +369,12 @@ pick fa1afe1 The oneline of the next commit
...
-------------------------------------------
The oneline descriptions are purely for your pleasure; 'git-rebase' will
The oneline descriptions are purely for your pleasure; 'git rebase' will
not look at them but at the commit names ("deadbee" and "fa1afe1" in this
example), so do not delete or edit the names.
By replacing the command "pick" with the command "edit", you can tell
'git-rebase' to stop after applying that commit, so that you can edit
'git rebase' to stop after applying that commit, so that you can edit
the files and/or the commit message, amend the commit, and continue
rebasing.
@ -386,13 +386,13 @@ If you want to fold two or more commits into one, replace the command
@@ -386,13 +386,13 @@ If you want to fold two or more commits into one, replace the command
commits had different authors, it will attribute the squashed commit to
the author of the first commit.
'git-rebase' will stop when "pick" has been replaced with "edit" or
'git rebase' will stop when "pick" has been replaced with "edit" or
when a command fails due to merge errors. When you are done editing
and/or resolving conflicts you can continue with `git rebase --continue`.
For example, if you want to reorder the last 5 commits, such that what
was HEAD~4 becomes the new HEAD. To achieve that, you would call
In interactive mode, you can mark commits with the action "edit". However,
this does not necessarily mean that 'git-rebase' expects the result of this
this does not necessarily mean that 'git rebase' expects the result of this
edit to be exactly one commit. Indeed, you can undo the commit, or you can
add other commits. This can be used to split a commit into two:
@ -438,7 +438,7 @@ add other commits. This can be used to split a commit into two:
@@ -438,7 +438,7 @@ add other commits. This can be used to split a commit into two:
- Now add the changes to the index that you want to have in the first
commit. You can use `git add` (possibly interactively) or
'git-gui' (or both) to do that.
'git gui' (or both) to do that.
- Commit the now-current index with whatever commit message is appropriate
now.
@ -449,7 +449,7 @@ add other commits. This can be used to split a commit into two:
@@ -449,7 +449,7 @@ add other commits. This can be used to split a commit into two:
If you are not absolutely sure that the intermediate revisions are
consistent (they compile, pass the testsuite, etc.) you should use
'git-stash' to stash away the not-yet-committed changes
'git stash' to stash away the not-yet-committed changes
after each commit, test, and amend the commit if fixes are necessary.
@ -524,7 +524,7 @@ Only works if the changes (patch IDs based on the diff contents) on
@@ -524,7 +524,7 @@ Only works if the changes (patch IDs based on the diff contents) on
'subsystem' are literally the same before and after the rebase
'subsystem' did.
In that case, the fix is easy because 'git-rebase' knows to skip
In that case, the fix is easy because 'git rebase' knows to skip
changes that are already present in the new upstream. So if you say
(assuming you're on 'topic')
------------
@ -551,12 +551,12 @@ NOTE: While an "easy case recovery" sometimes appears to be successful
@@ -551,12 +551,12 @@ NOTE: While an "easy case recovery" sometimes appears to be successful
example, a commit that was removed via `git rebase
\--interactive` will be **resurrected**!
The idea is to manually tell 'git-rebase' "where the old 'subsystem'
The idea is to manually tell 'git rebase' "where the old 'subsystem'
ended and your 'topic' began", that is, what the old merge-base
between them was. You will have to find a way to name the last commit
of the old 'subsystem', for example:
* With the 'subsystem' reflog: after 'git-fetch', the old tip of
* With the 'subsystem' reflog: after 'git fetch', the old tip of
'subsystem' is at `subsystem@\{1}`. Subsequent fetches will
@ -8,15 +8,15 @@ git-receive-pack - Receive what is pushed into the repository
@@ -8,15 +8,15 @@ git-receive-pack - Receive what is pushed into the repository
SYNOPSIS
--------
'git receive-pack' <directory>
'git-receive-pack' <directory>
DESCRIPTION
-----------
Invoked by 'git-send-pack' and updates the repository with the
Invoked by 'git send-pack' and updates the repository with the
information fed from the remote end.
This command is usually not invoked directly by the end user.
The UI for the protocol is on the 'git-send-pack' side, and the
The UI for the protocol is on the 'git send-pack' side, and the
program pair is meant to be used to push updates to remote
repository. For pull operations, see linkgit:git-fetch-pack[1].
@ -30,14 +30,14 @@ enable this command.
@@ -30,14 +30,14 @@ enable this command.
COMMANDS
--------
Normally, 'git-rerere' is run without arguments or user-intervention.
Normally, 'git rerere' is run without arguments or user-intervention.
However, it has several commands that allow it to interact with
its working state.
'clear'::
This resets the metadata used by rerere if a merge resolution is to be
aborted. Calling 'git-am [--skip|--abort]' or 'git-rebase [--skip|--abort]'
aborted. Calling 'git am [--skip|--abort]' or 'git rebase [--skip|--abort]'
will automatically invoke this command.
'diff'::
@ -142,32 +142,32 @@ finally ready and merged into the master branch. This merge
@@ -142,32 +142,32 @@ finally ready and merged into the master branch. This merge
would require you to resolve the conflict, introduced by the
commits marked with `*`. However, this conflict is often the
same conflict you resolved when you created the test merge you
blew away. 'git-rerere' helps you resolve this final
blew away. 'git rerere' helps you resolve this final
conflicted merge using the information from your earlier hand
resolve.
Running the 'git-rerere' command immediately after a conflicted
Running the 'git rerere' command immediately after a conflicted
automerge records the conflicted working tree files, with the
usual conflict markers `<<<<<<<`, `=======`, and `>>>>>>>` in
them. Later, after you are done resolving the conflicts,
running 'git-rerere' again will record the resolved state of these
running 'git rerere' again will record the resolved state of these
files. Suppose you did this when you created the test merge of
master into the topic branch.
Next time, after seeing the same conflicted automerge,
running 'git-rerere' will perform a three-way merge between the
running 'git rerere' will perform a three-way merge between the
earlier conflicted automerge, the earlier manual resolution, and
the current conflicted automerge.
If this three-way merge resolves cleanly, the result is written
out to your working tree file, so you do not have to manually
resolve it. Note that 'git-rerere' leaves the index file alone,
resolve it. Note that 'git rerere' leaves the index file alone,
so you still need to do the final sanity checks with `git diff`
(or `git diff -c`) and 'git-add' when you are satisfied.
(or `git diff -c`) and 'git add' when you are satisfied.
As a convenience measure, 'git-merge' automatically invokes
'git-rerere' upon exiting with a failed automerge and 'git-rerere'
As a convenience measure, 'git merge' automatically invokes
'git rerere' upon exiting with a failed automerge and 'git rerere'
records the hand resolve when it is a new conflict, or reuses the earlier hand
resolve when it is not. 'git-commit' also invokes 'git-rerere'
resolve when it is not. 'git commit' also invokes 'git rerere'
when committing a merge result. What this means is that you do
not have to do anything special yourself (besides enabling
the rerere.enabled config variable).
@ -177,8 +177,8 @@ resolution is recorded, and it will be reused when you do the
@@ -177,8 +177,8 @@ resolution is recorded, and it will be reused when you do the
actual merge later with the updated master and topic branch, as long
as the recorded resolution is still applicable.
The information 'git-rerere' records is also used when running
'git-rebase'. After blowing away the test merge and continuing
The information 'git rerere' records is also used when running
'git rebase'. After blowing away the test merge and continuing
development on the topic branch:
------------
@ -197,7 +197,7 @@ you could run `git rebase master topic`, to bring yourself
@@ -197,7 +197,7 @@ you could run `git rebase master topic`, to bring yourself
up-to-date before your topic is ready to be sent upstream.
This would result in falling back to a three-way merge, and it
would conflict the same way as the test merge you resolved earlier.
'git-rerere' will be run by 'git-rebase' to help you resolve this
'git rerere' will be run by 'git rebase' to help you resolve this
@ -9,7 +9,7 @@ git-rev-list - Lists commit objects in reverse chronological order
@@ -9,7 +9,7 @@ git-rev-list - Lists commit objects in reverse chronological order
SYNOPSIS
--------
[verse]
'git-rev-list' [ \--max-count=number ]
'git rev-list' [ \--max-count=number ]
[ \--skip=number ]
[ \--max-age=timestamp ]
[ \--min-age=timestamp ]
@ -93,8 +93,8 @@ between the two operands. The following two commands are equivalent:
@@ -93,8 +93,8 @@ between the two operands. The following two commands are equivalent:
'rev-list' is a very essential git command, since it
provides the ability to build and traverse commit ancestry graphs. For
this reason, it has a lot of different options that enables it to be
Parse the date string, and output the corresponding
--max-age= parameter for 'git-rev-list'.
--max-age= parameter for 'git rev-list'.
--until=datestring::
--before=datestring::
Parse the date string, and output the corresponding
--min-age= parameter for 'git-rev-list'.
--min-age= parameter for 'git rev-list'.
<args>...::
Flags and parameters to be parsed.
@ -171,7 +171,7 @@ blobs contained in a commit.
@@ -171,7 +171,7 @@ blobs contained in a commit.
name the same commit object if there are no other object in
your repository whose object name starts with dae86e.
* An output from 'git-describe'; i.e. a closest tag, optionally
* An output from 'git describe'; i.e. a closest tag, optionally
followed by a dash and a number of commits, followed by a dash, a
`g`, and an abbreviated object name.
@ -197,13 +197,13 @@ blobs contained in a commit.
@@ -197,13 +197,13 @@ blobs contained in a commit.
+
HEAD names the commit your changes in the working tree is based on.
FETCH_HEAD records the branch you fetched from a remote repository
with your last 'git-fetch' invocation.
with your last 'git fetch' invocation.
ORIG_HEAD is created by commands that moves your HEAD in a drastic
way, to record the position of the HEAD before their operation, so that
you can change the tip of the branch back to the state before you ran
them easily.
MERGE_HEAD records the commit(s) you are merging into your branch
when you run 'git-merge'.
when you run 'git merge'.
* A ref followed by the suffix '@' with a date specification
enclosed in a brace
@ -308,7 +308,7 @@ G H I J
@@ -308,7 +308,7 @@ G H I J
SPECIFYING RANGES
-----------------
History traversing commands such as 'git-log' operate on a set
History traversing commands such as 'git log' operate on a set
of commits, not just a single commit. To these commands,
specifying a single revision with the notation described in the
previous section means the set of commits reachable from that
@ -349,7 +349,7 @@ Here are a handful of examples:
@@ -349,7 +349,7 @@ Here are a handful of examples:
PARSEOPT
--------
In `--parseopt` mode, 'git-rev-parse' helps massaging options to bring to shell
In `--parseopt` mode, 'git rev-parse' helps massaging options to bring to shell
scripts the same facilities C builtins have. It works as an option normalizer
(e.g. splits single switches aggregate values), a bit like `getopt(1)` does.
@ -361,7 +361,7 @@ usage on the standard error stream, and exits with code 129.
@@ -361,7 +361,7 @@ usage on the standard error stream, and exits with code 129.
Input Format
~~~~~~~~~~~~
'git-rev-parse --parseopt' input format is fully text based. It has two parts,
'git rev-parse --parseopt' input format is fully text based. It has two parts,
separated by a line that contains only `--`. The lines before the separator
(should be more than one) are used for the usage.
The lines after the separator describe the options.
With this option, 'git-revert' will let you edit the commit
With this option, 'git revert' will let you edit the commit
message prior to committing the revert. This is the default if
you run the command from a terminal.
@ -54,7 +54,7 @@ See the link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for
@@ -54,7 +54,7 @@ See the link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for
more details.
--no-edit::
With this option, 'git-revert' will not start the commit
With this option, 'git revert' will not start the commit
@ -16,7 +16,7 @@ This is not a command the end user would want to run. Ever.
@@ -16,7 +16,7 @@ This is not a command the end user would want to run. Ever.
This documentation is meant for people who are studying the
Porcelain-ish scripts and/or are writing new ones.
The 'git-sh-setup' scriptlet is designed to be sourced (using
The 'git sh-setup' scriptlet is designed to be sourced (using
`.`) by other shell scripts to set up some variables pointing at
the normal git directories and a few helper shell functions.
Make 'git-show-ref' act as a filter that reads refs from stdin of the
Make 'git show-ref' act as a filter that reads refs from stdin of the
form "^(?:<anything>\s)?<refname>(?:\^\{\})?$" and performs the
following actions on each:
(1) strip "^{}" at the end of line if any;
@ -135,7 +135,7 @@ When using the '--verify' flag, the command requires an exact path:
@@ -135,7 +135,7 @@ When using the '--verify' flag, the command requires an exact path:
will only match the exact branch called "master".
If nothing matches, 'git-show-ref' will return an error code of 1,
If nothing matches, 'git show-ref' will return an error code of 1,
and in the case of verification, it will show an error message.
For scripting, you can ask it to be quiet with the "--quiet" flag, which
@ -16,16 +16,16 @@ Shows one or more objects (blobs, trees, tags and commits).
@@ -16,16 +16,16 @@ Shows one or more objects (blobs, trees, tags and commits).
For commits it shows the log message and textual diff. It also
presents the merge commit in a special format as produced by
'git-diff-tree --cc'.
'git diff-tree --cc'.
For tags, it shows the tag message and the referenced objects.
For trees, it shows the names (equivalent to 'git-ls-tree'
For trees, it shows the names (equivalent to 'git ls-tree'
with \--name-only).
For plain blobs, it shows the plain contents.
The command takes options applicable to the 'git-diff-tree' command to
The command takes options applicable to the 'git diff-tree' command to
control how the changes the commit introduces are shown.
This manual page describes only the most frequently used options.
@ -17,7 +17,7 @@ current HEAD commit, paths that have differences between the working
@@ -17,7 +17,7 @@ current HEAD commit, paths that have differences between the working
tree and the index file, and paths in the working tree that are not
tracked by git (and are not ignored by linkgit:gitignore[5]). The first
are what you _would_ commit by running `git commit`; the second and
third are what you _could_ commit by running 'git-add' before running
third are what you _could_ commit by running 'git add' before running
@ -99,11 +99,11 @@ locate the submodule using the relative URL in .gitmodules.
@@ -99,11 +99,11 @@ locate the submodule using the relative URL in .gitmodules.
status::
Show the status of the submodules. This will print the SHA-1 of the
currently checked out commit for each submodule, along with the
submodule path and the output of 'git-describe' for the
submodule path and the output of 'git describe' for the
SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not
initialized and `+` if the currently checked out submodule commit
does not match the SHA-1 found in the index of the containing
repository. This command is the default command for 'git-submodule'.
repository. This command is the default command for 'git submodule'.
+
If '--recursive' is specified, this command will recurse into nested
@ -49,7 +49,7 @@ cumbersome. On some platforms, `ln -sf` does not even work as
@@ -49,7 +49,7 @@ cumbersome. On some platforms, `ln -sf` does not even work as
advertised (horrors). Therefore symbolic links are now deprecated
and symbolic refs are used by default.
'git-symbolic-ref' will exit with status 0 if the contents of the
'git symbolic-ref' will exit with status 0 if the contents of the
symbolic ref were printed correctly, with status 1 if the requested
name is not a symbolic ref, or 128 if another error occurs.
If --refresh finds unmerged changes in the index, the default
behavior is to error out. This option makes 'git-update-index'
behavior is to error out. This option makes 'git update-index'
continue anyway.
--ignore-missing::
@ -105,7 +105,7 @@ you will need to handle the situation manually.
@@ -105,7 +105,7 @@ you will need to handle the situation manually.
-g::
--again::
Runs 'git-update-index' itself on the paths whose index
Runs 'git update-index' itself on the paths whose index
entries are different from those from the `HEAD` commit.
--unresolve::
@ -123,7 +123,7 @@ you will need to handle the situation manually.
@@ -123,7 +123,7 @@ you will need to handle the situation manually.
--replace::
By default, when a file `path` exists in the index,
'git-update-index' refuses an attempt to add `path/file`.
'git update-index' refuses an attempt to add `path/file`.
Similarly if a file `path/file` exists, a file `path`
cannot be added. With --replace flag, existing entries
that conflict with the entry being added are
@ -159,7 +159,7 @@ up-to-date for mode/content changes. But what it *does* do is to
@@ -159,7 +159,7 @@ up-to-date for mode/content changes. But what it *does* do is to
can refresh the index for a file that hasn't been changed but where
the stat entry is out of date.
For example, you'd want to do this after doing a 'git-read-tree', to link
For example, you'd want to do this after doing a 'git read-tree', to link
up the stat index details with the proper files.
Using --cacheinfo or --info-only
@ -200,13 +200,13 @@ back on 3-way merge.
@@ -200,13 +200,13 @@ back on 3-way merge.
. mode SP type SP sha1 TAB path
+
The second format is to stuff 'git-ls-tree' output
The second format is to stuff 'git ls-tree' output
into the index file.
. mode SP sha1 SP stage TAB path
+
This format is to put higher order stages into the
index file and matches 'git-ls-files --stage' output.
index file and matches 'git ls-files --stage' output.
To place a higher stage entry to the index, the path should
first be removed by feeding a mode=0 entry for the path, and
@ -263,8 +263,8 @@ option. To unset, use `--no-assume-unchanged`.
@@ -263,8 +263,8 @@ option. To unset, use `--no-assume-unchanged`.
The command looks at `core.ignorestat` configuration variable. When
this is true, paths updated with `git update-index paths...` and
paths updated with other git commands that update both index and
working tree (e.g. 'git-apply --index', 'git-checkout-index -u',
and 'git-read-tree -u') are automatically marked as "assume
working tree (e.g. 'git apply --index', 'git checkout-index -u',
and 'git read-tree -u') are automatically marked as "assume
unchanged". Note that "assume unchanged" bit is *not* set if
`git update-index --refresh` finds the working tree file matches
the index (use `git update-index --really-refresh` if you want
@ -317,7 +317,7 @@ unreliable, this should be set to 'false' (see linkgit:git-config[1]).
@@ -317,7 +317,7 @@ unreliable, this should be set to 'false' (see linkgit:git-config[1]).
This causes the command to ignore differences in file modes recorded
in the index and the file mode on the filesystem if they differ only on
executable bit. On such an unfortunate filesystem, you may
need to use 'git-update-index --chmod='.
need to use 'git update-index --chmod='.
Quite similarly, if `core.symlinks` configuration variable is set
to 'false' (see linkgit:git-config[1]), symbolic links are checked out
When the browser, specified by options or configuration variables, is
not among the supported ones, then the corresponding
'browser.<tool>.cmd' configuration variable will be looked up. If this
variable exists then 'git-web--browse' will treat the specified tool
variable exists then 'git web--browse' will treat the specified tool
as a custom command and will use a shell eval to run the command with
the URLs passed as arguments.
@ -113,7 +113,7 @@ See linkgit:git-config[1] for more information about this.
@@ -113,7 +113,7 @@ See linkgit:git-config[1] for more information about this.
Author
------
Written by Christian Couder <chriscool@tuxfamily.org> and the git-list
<git@vger.kernel.org>, based on 'git-mergetool' by Theodore Y. Ts'o.
<git@vger.kernel.org>, based on 'git mergetool' by Theodore Y. Ts'o.
@ -88,9 +88,9 @@ Checking-out and checking-in
@@ -88,9 +88,9 @@ Checking-out and checking-in
These attributes affect how the contents stored in the
repository are copied to the working tree files when commands
such as 'git-checkout' and 'git-merge' run. They also affect how
such as 'git checkout' and 'git merge' run. They also affect how
git stores the contents you prepare in the working tree in the
repository upon 'git-add' and 'git-commit'.
repository upon 'git add' and 'git commit'.
`crlf`
^^^^^^
@ -148,16 +148,16 @@ an irreversible conversion. The safety triggers to prevent such
@@ -148,16 +148,16 @@ an irreversible conversion. The safety triggers to prevent such
a conversion done to the files in the work tree, but there are a
few exceptions. Even though...
- 'git-add' itself does not touch the files in the work tree, the
- 'git add' itself does not touch the files in the work tree, the
next checkout would, so the safety triggers;
- 'git-apply' to update a text file with a patch does touch the files
- 'git apply' to update a text file with a patch does touch the files
in the work tree, but the operation is about text files and CRLF
conversion is about fixing the line ending inconsistencies, so the
safety does not trigger;
- 'git-diff' itself does not touch the files in the work tree, it is
often run to inspect the changes you intend to next 'git-add'. To
- 'git diff' itself does not touch the files in the work tree, it is
often run to inspect the changes you intend to next 'git add'. To
@ -44,7 +44,7 @@ to import into git.
@@ -44,7 +44,7 @@ to import into git.
For our first example, we're going to start a totally new repository from
scratch, with no pre-existing files, and we'll call it 'git-tutorial'.
To start up, create a subdirectory for it, change into that
subdirectory, and initialize the git infrastructure with 'git-init':
subdirectory, and initialize the git infrastructure with 'git init':
------------------------------------------------
$ mkdir git-tutorial
@ -139,7 +139,7 @@ but to actually check in your hard work, you will have to go through two steps:
@@ -139,7 +139,7 @@ but to actually check in your hard work, you will have to go through two steps:
- commit that index file as an object.
The first step is trivial: when you want to tell git about any changes
to your working tree, you use the 'git-update-index' program. That
to your working tree, you use the 'git update-index' program. That
program normally just takes a list of filenames you want to update, but
to avoid trivial mistakes, it refuses to add new entries to the index
(or remove existing ones) unless you explicitly tell it that you're
@ -173,14 +173,14 @@ and see two files:
@@ -173,14 +173,14 @@ and see two files:
which correspond with the objects with names of `557db...` and
`f24c7...` respectively.
If you want to, you can use 'git-cat-file' to look at those objects, but
If you want to, you can use 'git cat-file' to look at those objects, but
you'll have to use the object name, not the filename of the object:
where the `-t` tells 'git-cat-file' to tell you what the "type" of the
where the `-t` tells 'git cat-file' to tell you what the "type" of the
object is. git will tell you that you have a "blob" object (i.e., just a
regular file), and you can see the contents with
@ -205,7 +205,7 @@ hexadecimal digits in most places.
@@ -205,7 +205,7 @@ hexadecimal digits in most places.
Anyway, as we mentioned previously, you normally never actually take a
look at the objects themselves, and typing long 40-character hex
names is not something you'd normally want to do. The above digression
was just to show that 'git-update-index' did something magical, and
was just to show that 'git update-index' did something magical, and
actually saved away the contents of your files into the git object
database.
@ -228,7 +228,7 @@ $ echo "It's a new day for git" >>hello
@@ -228,7 +228,7 @@ $ echo "It's a new day for git" >>hello
and you can now, since you told git about the previous state of `hello`, ask
git what has changed in the tree compared to your old index, using the
'git-diff-files' command:
'git diff-files' command:
------------
$ git diff-files
@ -239,7 +239,7 @@ version of a 'diff', but that internal version really just tells you
@@ -239,7 +239,7 @@ version of a 'diff', but that internal version really just tells you
that it has noticed that "hello" has been modified, and that the old object
contents it had have been replaced with something else.
To make it readable, we can tell 'git-diff-files' to output the
To make it readable, we can tell 'git diff-files' to output the
differences as a patch, using the `-p` flag:
------------
@ -255,7 +255,7 @@ index 557db03..263414f 100644
@@ -255,7 +255,7 @@ index 557db03..263414f 100644
i.e. the diff of the change we caused by adding another line to `hello`.
In other words, 'git-diff-files' always shows us the difference between
In other words, 'git diff-files' always shows us the difference between
what is recorded in the index, and what is currently in the working
tree. That's very useful.
@ -283,7 +283,7 @@ that in two phases: creating a 'tree' object, and committing that 'tree'
@@ -283,7 +283,7 @@ that in two phases: creating a 'tree' object, and committing that 'tree'
object as a 'commit' object together with an explanation of what the
tree was all about, along with information of how we came to that state.
Creating a tree object is trivial, and is done with 'git-write-tree'.
Creating a tree object is trivial, and is done with 'git write-tree'.
There are no options or other input: `git write-tree` will take the
current index state, and write an object that describes that whole
index. In other words, we're now tying together all the different
@ -307,23 +307,23 @@ is not a "blob" object, but a "tree" object (you can also use
@@ -307,23 +307,23 @@ is not a "blob" object, but a "tree" object (you can also use
`git cat-file` to actually output the raw object contents, but you'll see
mainly a binary mess, so that's less interesting).
However -- normally you'd never use 'git-write-tree' on its own, because
However -- normally you'd never use 'git write-tree' on its own, because
normally you always commit a tree into a commit object using the
'git-commit-tree' command. In fact, it's easier to not actually use
'git-write-tree' on its own at all, but to just pass its result in as an
argument to 'git-commit-tree'.
'git commit-tree' command. In fact, it's easier to not actually use
'git write-tree' on its own at all, but to just pass its result in as an
argument to 'git commit-tree'.
'git-commit-tree' normally takes several arguments -- it wants to know
'git commit-tree' normally takes several arguments -- it wants to know
what the 'parent' of a commit was, but since this is the first commit
ever in this new repository, and it has no parents, we only need to pass in
the object name of the tree. However, 'git-commit-tree' also wants to get a
the object name of the tree. However, 'git commit-tree' also wants to get a
commit message on its standard input, and it will write out the resulting
object name for the commit to its standard output.
And this is where we create the `.git/refs/heads/master` file
which is pointed at by `HEAD`. This file is supposed to contain
the reference to the top-of-tree of the master branch, and since
that's exactly what 'git-commit-tree' spits out, we can do this
that's exactly what 'git commit-tree' spits out, we can do this
all with a sequence of simple shell commands:
------------------------------------------------
@ -345,11 +345,11 @@ instead, and it would have done the above magic scripting for you.
@@ -345,11 +345,11 @@ instead, and it would have done the above magic scripting for you.
Making a change
---------------
Remember how we did the 'git-update-index' on file `hello` and then we
Remember how we did the 'git update-index' on file `hello` and then we
changed `hello` afterward, and could compare the new state of `hello` with the
state we saved in the index file?
Further, remember how I said that 'git-write-tree' writes the contents
Further, remember how I said that 'git write-tree' writes the contents
of the *index* file to the tree, and thus what we just committed was in
fact the *original* contents of the file `hello`, not the new ones. We did
that on purpose, to show the difference between the index state, and the
@ -360,12 +360,12 @@ As before, if we do `git diff-files -p` in our git-tutorial project,
@@ -360,12 +360,12 @@ As before, if we do `git diff-files -p` in our git-tutorial project,
we'll still see the same difference we saw last time: the index file
hasn't changed by the act of committing anything. However, now that we
have committed something, we can also learn to use a new command:
'git-diff-index'.
'git diff-index'.
Unlike 'git-diff-files', which showed the difference between the index
file and the working tree, 'git-diff-index' shows the differences
Unlike 'git diff-files', which showed the difference between the index
file and the working tree, 'git diff-index' shows the differences
between a committed *tree* and either the index file or the working
tree. In other words, 'git-diff-index' wants a tree to be diffed
tree. In other words, 'git diff-index' wants a tree to be diffed
against, and before we did the commit, we couldn't do that, because we
didn't have anything to diff against.
@ -375,7 +375,7 @@ But now we can do
@@ -375,7 +375,7 @@ But now we can do
$ git diff-index -p HEAD
----------------
(where `-p` has the same meaning as it did in 'git-diff-files'), and it
(where `-p` has the same meaning as it did in 'git diff-files'), and it
will show us the same difference, but for a totally different reason.
Now we're comparing the working tree not against the index file,
but against the tree we just wrote. It just so happens that those two
@ -390,7 +390,7 @@ $ git diff HEAD
@@ -390,7 +390,7 @@ $ git diff HEAD
which ends up doing the above for you.
In other words, 'git-diff-index' normally compares a tree against the
In other words, 'git diff-index' normally compares a tree against the
working tree, but when given the `\--cached` flag, it is told to
instead compare against just the index cache contents, and ignore the
current working tree state entirely. Since we just wrote the index
@ -399,7 +399,7 @@ an empty set of differences, and that's exactly what it does.
@@ -399,7 +399,7 @@ an empty set of differences, and that's exactly what it does.
[NOTE]
================
'git-diff-index' really always uses the index for its
'git diff-index' really always uses the index for its
comparisons, and saying that it compares a tree against the working
tree is thus not strictly accurate. In particular, the list of
files to compare (the "meta-data") *always* comes from the index file,
(note how we didn't need the `\--add` flag this time, since git knew
about the file already).
Note what happens to the different 'git-diff-\*' versions here. After
Note what happens to the different 'git diff-\*' versions here. After
we've updated `hello` in the index, `git diff-files -p` now shows no
differences, but `git diff-index -p HEAD` still *does* show that the
current state is different from the state we committed. In fact, now
'git-diff-index' shows the same difference whether we use the `--cached`
'git diff-index' shows the same difference whether we use the `--cached`
flag or not, since now the index is coherent with the working tree.
Now, since we've updated `hello` in the index, we can commit the new
@ -460,7 +460,7 @@ You've now made your first real git commit. And if you're interested in
@@ -460,7 +460,7 @@ You've now made your first real git commit. And if you're interested in
looking at what `git commit` really does, feel free to investigate:
it's a few very simple shell scripts to generate the helpful (?) commit
message headers, and a few one-liners that actually do the
While creating changes is useful, it's even more useful if you can tell
later what changed. The most useful command for this is another of the
'diff' family, namely 'git-diff-tree'.
'diff' family, namely 'git diff-tree'.
'git-diff-tree' can be given two arbitrary trees, and it will tell you the
'git diff-tree' can be given two arbitrary trees, and it will tell you the
differences between them. Perhaps even more commonly, though, you can
give it just a single commit object, and it will figure out the parent
of that commit itself, and show the difference directly. Thus, to get
@ -518,15 +518,15 @@ various diff-\* commands compare things.
@@ -518,15 +518,15 @@ various diff-\* commands compare things.
+-----------+
============
More interestingly, you can also give 'git-diff-tree' the `--pretty` flag,
More interestingly, you can also give 'git diff-tree' the `--pretty` flag,
which tells it to also show the commit message and author and date of the
commit, and you can tell it to show a whole series of diffs.
Alternatively, you can tell it to be "silent", and not show the diffs at
all, but just show the actual commit message.
In fact, together with the 'git-rev-list' program (which generates a
list of revisions), 'git-diff-tree' ends up being a veritable fount of
changes. A trivial (but very useful) script called 'git-whatchanged' is
In fact, together with the 'git rev-list' program (which generates a
list of revisions), 'git diff-tree' ends up being a veritable fount of
changes. A trivial (but very useful) script called 'git whatchanged' is
included with git which does exactly this, and shows a log of recent
activities.
@ -553,14 +553,14 @@ When using the above two commands, the initial commit will be shown.
@@ -553,14 +553,14 @@ When using the above two commands, the initial commit will be shown.
If this is a problem because it is huge, you can hide it by setting
the log.showroot configuration variable to false. Having this, you
can still show it for each command just adding the `\--root` option,
which is a flag for 'git-diff-tree' accepted by both commands.
which is a flag for 'git diff-tree' accepted by both commands.
With that, you should now be having some inkling of what git does, and
can explore on your own.
[NOTE]
Most likely, you are not directly using the core
git Plumbing commands, but using Porcelain such as 'git-add', `git-rm'
git Plumbing commands, but using Porcelain such as 'git add', `git-rm'
and `git-commit'.
@ -595,7 +595,7 @@ pointer to the state you want to tag, but also a small tag name and
@@ -595,7 +595,7 @@ pointer to the state you want to tag, but also a small tag name and
message, along with optionally a PGP signature that says that yes,
you really did
that tag. You create these annotated tags with either the `-a` or
`-s` flag to 'git-tag':
`-s` flag to 'git tag':
----------------
$ git tag -s <tagname>
@ -642,7 +642,7 @@ and it will be gone. There's no external repository, and there's no
@@ -642,7 +642,7 @@ and it will be gone. There's no external repository, and there's no
history outside the project you created.
- if you want to move or duplicate a git repository, you can do so. There
is 'git-clone' command, but if all you want to do is just to
is 'git clone' command, but if all you want to do is just to
create a copy of your repository (with all the full history that
went along with it), you can do so with a regular
`cp -a git-tutorial new-git-tutorial`.
@ -666,7 +666,7 @@ When copying a remote repository, you'll want to at a minimum update the
@@ -666,7 +666,7 @@ When copying a remote repository, you'll want to at a minimum update the
index cache when you do this, and especially with other peoples'
repositories you often want to make sure that the index cache is in some
known state (you don't know *what* they've done and not yet checked in),
so usually you'll precede the 'git-update-index' with a
so usually you'll precede the 'git update-index' with a
and in fact a lot of the common git command combinations can be scripted
with the `git xyz` interfaces. You can learn things by just looking
at what the various git scripts do. For example, `git reset` used to be
the above two lines implemented in 'git-reset', but some things like
'git-status' and 'git-commit' are slightly more complex scripts around
the above two lines implemented in 'git reset', but some things like
'git status' and 'git commit' are slightly more complex scripts around
the basic git commands.
Many (most?) public remote repositories will not contain any of
@ -729,7 +729,7 @@ where the `-u` flag means that you want the checkout to keep the index
@@ -729,7 +729,7 @@ where the `-u` flag means that you want the checkout to keep the index
up-to-date (so that you don't have to refresh it afterward), and the
`-a` flag means "check out all files" (if you have a stale copy or an
older version of a checked out tree you may also need to add the `-f`
flag first, to tell 'git-checkout-index' to *force* overwriting of any old
flag first, to tell 'git checkout-index' to *force* overwriting of any old
files).
Again, this can all be simplified with
@ -776,7 +776,7 @@ to it.
@@ -776,7 +776,7 @@ to it.
================================================
If you make the decision to start your new branch at some
other point in the history than the current `HEAD`, you can do so by
just telling 'git-checkout' what the base of the checkout would be.
just telling 'git checkout' what the base of the checkout would be.
In other words, if you have an earlier tag or branch, you'd just do
which will very loudly warn you that you're now committing a merge
(which is correct, so never mind), and you can write a small merge
message about your adventures in 'git-merge'-land.
message about your adventures in 'git merge'-land.
After you're done, start up `gitk \--all` to see graphically what the
history looks like. Notice that `mybranch` still exists, and you can
@ -967,21 +967,21 @@ branch head. Please see linkgit:git-rev-parse[1] if you want to
@@ -967,21 +967,21 @@ branch head. Please see linkgit:git-rev-parse[1] if you want to
see more complex cases.
[NOTE]
Without the '--more=1' option, 'git-show-branch' would not output the
Without the '--more=1' option, 'git show-branch' would not output the
'[master^]' commit, as '[mybranch]' commit is a common ancestor of
both 'master' and 'mybranch' tips. Please see linkgit:git-show-branch[1]
for details.
[NOTE]
If there were more commits on the 'master' branch after the merge, the
merge commit itself would not be shown by 'git-show-branch' by
merge commit itself would not be shown by 'git show-branch' by
default. You would need to provide '--sparse' option to make the
merge commit visible in this case.
Now, let's pretend you are the one who did all the work in
`mybranch`, and the fruit of your hard work has finally been merged
to the `master` branch. Let's go back to `mybranch`, and run
'git-merge' to get the "upstream changes" back to your branch.
'git merge' to get the "upstream changes" back to your branch.
------------
$ git checkout mybranch
@ -1023,12 +1023,12 @@ Merging external work
@@ -1023,12 +1023,12 @@ Merging external work
It's usually much more common that you merge with somebody else than
merging with your own branches, so it's worth pointing out that git
makes that very easy too, and in fact, it's not that different from
doing a 'git-merge'. In fact, a remote merge ends up being nothing
doing a 'git merge'. In fact, a remote merge ends up being nothing
more than "fetch the work from a remote repository into a temporary tag"
followed by a 'git-merge'.
followed by a 'git merge'.
Fetching from a remote repository is done by, unsurprisingly,
'git-fetch':
'git fetch':
----------------
$ git fetch <remote-repository>
@ -1095,7 +1095,7 @@ The 'commit walkers' are sometimes also called 'dumb
@@ -1095,7 +1095,7 @@ The 'commit walkers' are sometimes also called 'dumb
transports', because they do not require any git aware smart
server like git Native transport does. Any stock HTTP server
that does not even support directory index would suffice. But
you must prepare your repository with 'git-update-server-info'
you must prepare your repository with 'git update-server-info'
to help dumb transport downloaders.
Once you fetch from the remote repository, you `merge` that
Remember, before running 'git-merge', our `master` head was at
Remember, before running 'git merge', our `master` head was at
"Some fun." commit, while our `mybranch` head was at "Some
work." commit.
@ -1195,7 +1195,7 @@ Now we are ready to experiment with the merge by hand.
@@ -1195,7 +1195,7 @@ Now we are ready to experiment with the merge by hand.
`git merge` command, when merging two branches, uses 3-way merge
algorithm. First, it finds the common ancestor between them.
This is the state of the index file and the working file after
'git-merge' returns control back to you, leaving the conflicting
'git merge' returns control back to you, leaving the conflicting
merge for you to resolve. Notice that the path `hello` is still
unmerged, and what you see with 'git-diff' at this point is
unmerged, and what you see with 'git diff' at this point is
differences since stage 2 (i.e. your version).
@ -1328,8 +1328,8 @@ into it later. Obviously, this repository creation needs to be
@@ -1328,8 +1328,8 @@ into it later. Obviously, this repository creation needs to be
done only once.
[NOTE]
'git-push' uses a pair of commands,
'git-send-pack' on your local machine, and 'git-receive-pack'
'git push' uses a pair of commands,
'git send-pack' on your local machine, and 'git-receive-pack'
on the remote machine. The communication between the two over
will do it for you. If you followed the tutorial examples, you
would have accumulated about 17 objects in `.git/objects/??/`
directories by now. 'git-repack' tells you how many objects it
directories by now. 'git repack' tells you how many objects it
packed, and stores the packed file in `.git/objects/pack`
directory.
@ -1420,7 +1420,7 @@ them together. The former holds all the data from the objects
@@ -1420,7 +1420,7 @@ them together. The former holds all the data from the objects
in the pack, and the latter holds the index for random
access.
If you are paranoid, running 'git-verify-pack' command would
If you are paranoid, running 'git verify-pack' command would
detect if you have a corrupt pack, but do not worry too much.
Our programs are always perfect ;-).
@ -1487,17 +1487,17 @@ If other people are pulling from your repository over dumb
@@ -1487,17 +1487,17 @@ If other people are pulling from your repository over dumb
transport protocols (HTTP), you need to keep this repository
'dumb transport friendly'. After `git init`,
`$GIT_DIR/hooks/post-update.sample` copied from the standard templates
would contain a call to 'git-update-server-info'
would contain a call to 'git update-server-info'
but you need to manually enable the hook with
`mv post-update.sample post-update`. This makes sure
'git-update-server-info' keeps the necessary files up-to-date.
'git update-server-info' keeps the necessary files up-to-date.
3. Push into the public repository from your primary
repository.
4. 'git-repack' the public repository. This establishes a big
4. 'git repack' the public repository. This establishes a big
pack that contains the initial set of objects as the
baseline, and possibly 'git-prune' if the transport
baseline, and possibly 'git prune' if the transport
used for pulling from your repository supports packed
repositories.
@ -1511,14 +1511,14 @@ You can repack this private repository whenever you feel like.
@@ -1511,14 +1511,14 @@ You can repack this private repository whenever you feel like.
6. Push your changes to the public repository, and announce it
to the public.
7. Every once in a while, 'git-repack' the public repository.
7. Every once in a while, 'git repack' the public repository.
Go back to step 5. and continue working.
A recommended work cycle for a "subsystem maintainer" who works
on that project and has an own "public repository" goes like this:
1. Prepare your work repository, by 'git-clone' the public
1. Prepare your work repository, by 'git clone' the public
repository of the "project lead". The URL used for the
initial cloning is stored in the remote.origin.url
configuration variable.
@ -1533,7 +1533,7 @@ on that project and has an own "public repository" goes like this:
@@ -1533,7 +1533,7 @@ on that project and has an own "public repository" goes like this:
point at the repository you are borrowing from.
4. Push into the public repository from your primary
repository. Run 'git-repack', and possibly 'git-prune' if the
repository. Run 'git repack', and possibly 'git prune' if the
transport used for pulling from your repository supports
7. Every once in a while, 'git-repack' the public repository.
7. Every once in a while, 'git repack' the public repository.
Go back to step 5. and continue working.
@ -1558,7 +1558,7 @@ A recommended work cycle for an "individual developer" who does
@@ -1558,7 +1558,7 @@ A recommended work cycle for an "individual developer" who does
not have a "public" repository is somewhat different. It goes
like this:
1. Prepare your work repository, by 'git-clone' the public
1. Prepare your work repository, by 'git clone' the public
repository of the "project lead" (or a "subsystem
maintainer", if you work on a subsystem). The URL used for
the initial cloning is stored in the remote.origin.url