Skip to content
Snippets Groups Projects
Commit c2d4e9be authored by Jean-Noël Avila's avatar Jean-Noël Avila
Browse files

Integrate version 2.26.0

parent 5408558e
No related branches found
No related tags found
No related merge requests found
Showing with 2085 additions and 1406 deletions
GIT_VERSION = 2.25.0
GIT_VERSION = 2.26.0
......@@ -263,7 +263,9 @@ color::
+
The basic colors accepted are `normal`, `black`, `red`, `green`, `yellow`,
`blue`, `magenta`, `cyan` and `white`. The first color given is the
foreground; the second is the background.
foreground; the second is the background. All the basic colors except
`normal` have a bright variant that can be speficied by prefixing the
color with `bright`, like `brightred`.
+
Colors may also be given as numbers between 0 and 255; these use ANSI
256-color mode (but note that not all terminals may support this). If
......
......@@ -567,13 +567,13 @@ To illustrate the difference between `-S<regex> --pickaxe-regex` and
file:
+
----
+ return !regexec(regexp, two->ptr, 1, &regmatch, 0);
+ return frotz(nitfol, two->ptr, 1, 0);
...
- hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
- hit = frotz(nitfol, mf2.ptr, 1, 0);
----
+
While `git log -G"regexec\(regexp"` will show this commit, `git log
-S"regexec\(regexp" --pickaxe-regex` will not (because the number of
While `git log -G"frotz\(nitfol"` will show this commit, `git log
-S"frotz\(nitfol" --pickaxe-regex` will not (because the number of
occurrences of that string did not change).
+
Unless `--text` is supplied patches of binary files without a textconv
......
......@@ -139,7 +139,10 @@ ifndef::git-pull[]
specified refspec (can be given more than once) to map the
refs to remote-tracking branches, instead of the values of
`remote.*.fetch` configuration variables for the remote
repository. See section on "Configured Remote-tracking
repository. Providing an empty `<refspec>` to the
`--refmap` option causes Git to ignore the configured
refspecs and rely entirely on the refspecs supplied as
command-line arguments. See section on "Configured Remote-tracking
Branches" for details.
-t::
......
......@@ -16,7 +16,7 @@ SYNOPSIS
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
[--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
[(<mbox> | <Maildir>)...]
'git am' (--continue | --skip | --abort | --quit | --show-current-patch)
'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=(diff|raw)])
DESCRIPTION
-----------
......@@ -176,9 +176,11 @@ default. You can use `--no-utf8` to override this.
Abort the patching operation but keep HEAD and the index
untouched.
--show-current-patch::
Show the entire e-mail message "git am" has stopped at, because
of conflicts.
--show-current-patch[=(diff|raw)]::
Show the message at which `git am` has stopped due to
conflicts. If `raw` is specified, show the raw contents of
the e-mail message; if `diff`, show the diff portion only.
Defaults to `raw`.
DISCUSSION
----------
......
......@@ -30,9 +30,15 @@ OPTIONS
valid with a single pathname.
-v, --verbose::
Also output details about the matching pattern (if any)
for each given pathname. For precedence rules within and
between exclude sources, see linkgit:gitignore[5].
Instead of printing the paths that are excluded, for each path
that matches an exclude pattern, print the exclude pattern
together with the path. (Matching an exclude pattern usually
means the path is excluded, but if the pattern begins with '!'
then it is a negated pattern and matching it means the path is
NOT excluded.)
+
For precedence rules within and between exclude sources, see
linkgit:gitignore[5].
--stdin::
Read pathnames from the standard input, one per line,
......
......@@ -69,7 +69,6 @@ OPTIONS
Do not GPG-sign commit, to countermand a `--gpg-sign` option
given earlier on the command line.
Commit Information
------------------
......@@ -79,26 +78,6 @@ A commit encapsulates:
- author name, email and date
- committer name and email and the commit time.
While parent object ids are provided on the command line, author and
committer information is taken from the following environment variables,
if set:
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
(nb "<", ">" and "\n"s are stripped)
In case (some of) these environment variables are not set, the information
is taken from the configuration items user.name and user.email, or, if not
present, the environment variable EMAIL, or, if that is not set,
system user name and the hostname used for outgoing mail (taken
from `/etc/mailname` and falling back to the fully qualified hostname when
that file does not exist).
A commit comment is read from stdin. If a changelog
entry is not provided via "<" redirection, 'git commit-tree' will just wait
for one to be entered and terminated with ^D.
......@@ -117,6 +96,7 @@ FILES
SEE ALSO
--------
linkgit:git-write-tree[1]
linkgit:git-commit[1]
GIT
---
......
......@@ -367,9 +367,6 @@ changes to tracked files.
+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
:git-commit: 1
include::date-formats.txt[]
EXAMPLES
--------
When recording your own work, the contents of modified files in
......@@ -463,6 +460,43 @@ alter the order the changes are committed, because the merge
should be recorded as a single commit. In fact, the command
refuses to run when given pathnames (but see `-i` option).
COMMIT INFORMATION
------------------
Author and committer information is taken from the following environment
variables, if set:
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
(nb "<", ">" and "\n"s are stripped)
The author and committer names are by convention some form of a personal name
(that is, the name by which other humans refer to you), although Git does not
enforce or require any particular form. Arbitrary Unicode may be used, subject
to the constraints listed above. This name has no effect on authentication; for
that, see the `credential.username` variable in linkgit:git-config[1].
In case (some of) these environment variables are not set, the information
is taken from the configuration items `user.name` and `user.email`, or, if not
present, the environment variable EMAIL, or, if that is not set,
system user name and the hostname used for outgoing mail (taken
from `/etc/mailname` and falling back to the fully qualified hostname when
that file does not exist).
The `author.name` and `committer.name` and their corresponding email options
override `user.name` and `user.email` if set and are overridden themselves by
the environment variables.
The typical usage is to set just the `user.name` and `user.email` variables;
the other options are provided for more complex use cases.
:git-commit: 1
include::date-formats.txt[]
DISCUSSION
----------
......
......@@ -9,18 +9,18 @@ git-config - Get and set repository or global options
SYNOPSIS
--------
[verse]
'git config' [<file-option>] [--type=<type>] [--show-origin] [-z|--null] name [value [value_regex]]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] name [value [value_regex]]
'git config' [<file-option>] [--type=<type>] --add name value
'git config' [<file-option>] [--type=<type>] --replace-all name value [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [-z|--null] --get name [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [-z|--null] --get-all name [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] --get name [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] --get-all name [value_regex]
'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
'git config' [<file-option>] [--type=<type>] [-z|--null] --get-urlmatch name URL
'git config' [<file-option>] --unset name [value_regex]
'git config' [<file-option>] --unset-all name [value_regex]
'git config' [<file-option>] --rename-section old_name new_name
'git config' [<file-option>] --remove-section name
'git config' [<file-option>] [--show-origin] [-z|--null] [--name-only] -l | --list
'git config' [<file-option>] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list
'git config' [<file-option>] --get-color name [default]
'git config' [<file-option>] --get-colorbool name [stdout-is-tty]
'git config' [<file-option>] -e | --edit
......@@ -222,6 +222,11 @@ Valid `<type>`'s include:
the actual origin (config file path, ref, or blob id if
applicable).
--show-scope::
Similar to `--show-origin` in that it augments the output of
all queried config options with the scope of that value
(local, global, system, command).
--get-colorbool name [stdout-is-tty]::
Find the color setting for `name` (e.g. `color.diff`) and output
......
......@@ -467,9 +467,9 @@ impossible for a backward-compatible implementation to ever be fast:
* In editing files, git-filter-branch by design checks out each and
every commit as it existed in the original repo. If your repo has
10\^5 files and 10\^5 commits, but each commit only modifies 5
files, then git-filter-branch will make you do 10\^10 modifications,
despite only having (at most) 5*10^5 unique blobs.
`10^5` files and `10^5` commits, but each commit only modifies five
files, then git-filter-branch will make you do `10^10` modifications,
despite only having (at most) `5*10^5` unique blobs.
* If you try and cheat and try to make git-filter-branch only work on
files modified in a commit, then two things happen
......
......@@ -59,8 +59,8 @@ grep.extendedRegexp::
other than 'default'.
grep.threads::
Number of grep worker threads to use. If unset (or set to 0),
8 threads are used by default (for now).
Number of grep worker threads to use. If unset (or set to 0), Git will
use as many threads as the number of logical cores available.
grep.fullName::
If set to true, enable `--full-name` option by default.
......@@ -96,7 +96,8 @@ OPTIONS
Recursively search in each submodule that has been initialized and
checked out in the repository. When used in combination with the
<tree> option the prefix of all submodule output will be the name of
the parent project's <tree> object.
the parent project's <tree> object. This option has no effect
if `--no-index` is given.
-a::
--text::
......@@ -347,6 +348,17 @@ EXAMPLES
`git grep solution -- :^Documentation`::
Looks for `solution`, excluding files in `Documentation`.
NOTES ON THREADS
----------------
The `--threads` option (and the grep.threads configuration) will be ignored when
`--open-files-in-pager` is used, forcing a single-threaded execution.
When grepping the object store (with `--cached` or giving tree objects), running
with multiple threads might perform slower than single threaded if `--textconv`
is given and there're too many text conversions. So if you experience low
performance in this case, it might be desirable to use `--threads=1`.
GIT
---
Part of the linkgit:git[1] suite
......@@ -28,7 +28,9 @@ OPTIONS
Limit to only refs/heads and refs/tags, respectively.
These options are _not_ mutually exclusive; when given
both, references stored in refs/heads and refs/tags are
displayed.
displayed. Note that `git ls-remote -h` used without
anything else on the command line gives help, consistent
with other git subcommands.
--refs::
Do not show peeled tags or pseudorefs like `HEAD` in the output.
......
......@@ -258,16 +258,45 @@ See also INCOMPATIBLE OPTIONS below.
original branch. The index and working tree are also left
unchanged as a result.
--keep-empty::
Keep the commits that do not change anything from its
parents in the result.
--apply:
Use applying strategies to rebase (calling `git-am`
internally). This option may become a no-op in the future
once the merge backend handles everything the apply one does.
+
See also INCOMPATIBLE OPTIONS below.
--empty={drop,keep,ask}::
How to handle commits that are not empty to start and are not
clean cherry-picks of any upstream commit, but which become
empty after rebasing (because they contain a subset of already
upstream changes). With drop (the default), commits that
become empty are dropped. With keep, such commits are kept.
With ask (implied by --interactive), the rebase will halt when
an empty commit is applied allowing you to choose whether to
drop it, edit files more, or just commit the empty changes.
Other options, like --exec, will use the default of drop unless
-i/--interactive is explicitly specified.
+
Note that commits which start empty are kept, and commits which are
clean cherry-picks (as determined by `git log --cherry-mark ...`) are
always dropped.
+
See also INCOMPATIBLE OPTIONS below.
--keep-empty::
No-op. Rebasing commits that started empty (had no change
relative to their parent) used to fail and this option would
override that behavior, allowing commits with empty changes to
be rebased. Now commits with no changes do not cause rebasing
to halt.
+
See also BEHAVIORAL DIFFERENCES and INCOMPATIBLE OPTIONS below.
--allow-empty-message::
By default, rebasing commits with an empty message will fail.
This option overrides that behavior, allowing commits with empty
messages to be rebased.
No-op. Rebasing commits with an empty message used to fail
and this option would override that behavior, allowing commits
with empty messages to be rebased. Now commits with an empty
message do not cause rebasing to halt.
+
See also INCOMPATIBLE OPTIONS below.
......@@ -286,7 +315,7 @@ See also INCOMPATIBLE OPTIONS below.
--merge::
Use merging strategies to rebase. When the recursive (default) merge
strategy is used, this allows rebase to be aware of renames on the
upstream side.
upstream side. This is the default.
+
Note that a rebase merge works by replaying each commit from the working
branch on top of the <upstream> branch. Because of this, when a merge
......@@ -356,7 +385,7 @@ See also INCOMPATIBLE OPTIONS below.
Ensure at least <n> lines of surrounding context match before
and after each change. When fewer lines of surrounding
context exist they all must match. By default no context is
ever ignored.
ever ignored. Implies --apply.
+
See also INCOMPATIBLE OPTIONS below.
......@@ -394,8 +423,9 @@ with `--keep-base` in order to drop those commits from your branch.
--ignore-whitespace::
--whitespace=<option>::
These flag are passed to the 'git apply' program
These flags are passed to the 'git apply' program
(see linkgit:git-apply[1]) that applies the patch.
Implies --apply.
+
See also INCOMPATIBLE OPTIONS below.
......@@ -539,10 +569,11 @@ INCOMPATIBLE OPTIONS
The following options:
* --apply
* --committer-date-is-author-date
* --ignore-date
* --whitespace
* --ignore-whitespace
* --whitespace
* -C
are incompatible with the following options:
......@@ -557,6 +588,7 @@ are incompatible with the following options:
* --interactive
* --exec
* --keep-empty
* --empty=
* --edit-todo
* --root when used in combination with --onto
......@@ -565,33 +597,137 @@ In addition, the following pairs of options are incompatible:
* --preserve-merges and --interactive
* --preserve-merges and --signoff
* --preserve-merges and --rebase-merges
* --preserve-merges and --empty=
* --keep-base and --onto
* --keep-base and --root
BEHAVIORAL DIFFERENCES
-----------------------
There are some subtle differences how the backends behave.
git rebase has two primary backends: apply and merge. (The apply
backend used to known as the 'am' backend, but the name led to
confusion as it looks like a verb instead of a noun. Also, the merge
backend used to be known as the interactive backend, but it is now
used for non-interactive cases as well. Both were renamed based on
lower-level functionality that underpinned each.) There are some
subtle differences in how these two backends behave:
Empty commits
~~~~~~~~~~~~~
The am backend drops any "empty" commits, regardless of whether the
commit started empty (had no changes relative to its parent to
start with) or ended empty (all changes were already applied
upstream in other commits).
The apply backend unfortunately drops intentionally empty commits, i.e.
commits that started empty, though these are rare in practice. It
also drops commits that become empty and has no option for controlling
this behavior.
The interactive backend drops commits by default that
started empty and halts if it hits a commit that ended up empty.
The `--keep-empty` option exists for the interactive backend to allow
it to keep commits that started empty.
The merge backend keeps intentionally empty commits. Similar to the
apply backend, by default the merge backend drops commits that become
empty unless -i/--interactive is specified (in which case it stops and
asks the user what to do). The merge backend also has an
--empty={drop,keep,ask} option for changing the behavior of handling
commits that become empty.
Directory rename detection
~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory rename heuristics are enabled in the merge and interactive
backends. Due to the lack of accurate tree information, directory
rename detection is disabled in the am backend.
Due to the lack of accurate tree information (arising from
constructing fake ancestors with the limited information available in
patches), directory rename detection is disabled in the apply backend.
Disabled directory rename detection means that if one side of history
renames a directory and the other adds new files to the old directory,
then the new files will be left behind in the old directory without
any warning at the time of rebasing that you may want to move these
files into the new directory.
Directory rename detection works with the merge backend to provide you
warnings in such cases.
Context
~~~~~~~
The apply backend works by creating a sequence of patches (by calling
`format-patch` internally), and then applying the patches in sequence
(calling `am` internally). Patches are composed of multiple hunks,
each with line numbers, a context region, and the actual changes. The
line numbers have to be taken with some fuzz, since the other side
will likely have inserted or deleted lines earlier in the file. The
context region is meant to help find how to adjust the line numbers in
order to apply the changes to the right lines. However, if multiple
areas of the code have the same surrounding lines of context, the
wrong one can be picked. There are real-world cases where this has
caused commits to be reapplied incorrectly with no conflicts reported.
Setting diff.context to a larger value may prevent such types of
problems, but increases the chance of spurious conflicts (since it
will require more lines of matching context to apply).
The merge backend works with a full copy of each relevant file,
insulating it from these types of problems.
Labelling of conflicts markers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When there are content conflicts, the merge machinery tries to
annotate each side's conflict markers with the commits where the
content came from. Since the apply backend drops the original
information about the rebased commits and their parents (and instead
generates new fake commits based off limited information in the
generated patches), those commits cannot be identified; instead it has
to fall back to a commit summary. Also, when merge.conflictStyle is
set to diff3, the apply backend will use "constructed merge base" to
label the content from the merge base, and thus provide no information
about the merge base commit whatsoever.
The merge backend works with the full commits on both sides of history
and thus has no such limitations.
Hooks
~~~~~
The apply backend has not traditionally called the post-commit hook,
while the merge backend has. However, this was by accident of
implementation rather than by design. Both backends should have the
same behavior, though it is not clear which one is correct.
Interruptability
~~~~~~~~~~~~~~~~
The apply backend has safety problems with an ill-timed interrupt; if
the user presses Ctrl-C at the wrong time to try to abort the rebase,
the rebase can enter a state where it cannot be aborted with a
subsequent `git rebase --abort`. The merge backend does not appear to
suffer from the same shortcoming. (See
https://lore.kernel.org/git/20200207132152.GC2868@szeder.dev/ for
details.)
Commit Rewording
~~~~~~~~~~~~~~~~
When a conflict occurs while rebasing, rebase stops and asks the user
to resolve. Since the user may need to make notable changes while
resolving conflicts, after conflicts are resolved and the user has run
`git rebase --continue`, the rebase should open an editor and ask the
user to update the commit message. The merge backend does this, while
the apply backend blindly applies the original commit message.
Miscellaneous differences
~~~~~~~~~~~~~~~~~~~~~~~~~
There are a few more behavioral differences that most folks would
probably consider inconsequential but which are mentioned for
completeness:
* Reflog: The two backends will use different wording when describing
the changes made in the reflog, though both will make use of the
word "rebase".
* Progress, informational, and error messages: The two backends
provide slightly different progress and informational messages.
Also, the apply backend writes error messages (such as "Your files
would be overwritten...") to stdout, while the merge backend writes
them to stderr.
* State directories: The two backends keep their state in different
directories under .git/
include::merge-strategies.txt[]
......
......@@ -8,16 +8,18 @@ git-rm - Remove files from the working tree and from the index
SYNOPSIS
--------
[verse]
'git rm' [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file>...
'git rm' [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]
[--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]
DESCRIPTION
-----------
Remove files from the index, or from the working tree and the index.
`git rm` will not remove a file from just your working directory.
(There is no option to remove a file only from the working tree
and yet keep it in the index; use `/bin/rm` if you want to do that.)
The files being removed have to be identical to the tip of the branch,
and no updates to their contents can be staged in the index,
Remove files matching pathspec from the index, or from the working tree
and the index. `git rm` will not remove a file from just your working
directory. (There is no option to remove a file only from the working
tree and yet keep it in the index; use `/bin/rm` if you want to do
that.) The files being removed have to be identical to the tip of the
branch, and no updates to their contents can be staged in the index,
though that default behavior can be overridden with the `-f` option.
When `--cached` is given, the staged content has to
match either the tip of the branch or the file on disk,
......@@ -26,15 +28,20 @@ allowing the file to be removed from just the index.
OPTIONS
-------
<file>...::
Files to remove. Fileglobs (e.g. `*.c`) can be given to
remove all matching files. If you want Git to expand
file glob characters, you may need to shell-escape them.
A leading directory name
(e.g. `dir` to remove `dir/file1` and `dir/file2`) can be
given to remove all files in the directory, and recursively
all sub-directories,
but this requires the `-r` option to be explicitly given.
<pathspec>...::
Files to remove. A leading directory name (e.g. `dir` to remove
`dir/file1` and `dir/file2`) can be given to remove all files in
the directory, and recursively all sub-directories, but this
requires the `-r` option to be explicitly given.
+
The command removes only the paths that are known to Git.
+
File globbing matches across directory boundaries. Thus, given two
directories `d` and `d2`, there is a difference between using
`git rm 'd*'` and `git rm 'd/*'`, as the former will also remove all
of directory `d2`.
+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
-f::
--force::
......@@ -68,19 +75,19 @@ OPTIONS
`git rm` normally outputs one line (in the form of an `rm` command)
for each file removed. This option suppresses that output.
--pathspec-from-file=<file>::
Pathspec is passed in `<file>` instead of commandline args. If
`<file>` is exactly `-` then standard input is used. Pathspec
elements are separated by LF or CR/LF. Pathspec elements can be
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
global `--literal-pathspecs`.
DISCUSSION
----------
The <file> list given to the command can be exact pathnames,
file glob patterns, or leading directory names. The command
removes only the paths that are known to Git. Giving the name of
a file that you have not told Git about does not remove that file.
--pathspec-file-nul::
Only meaningful with `--pathspec-from-file`. Pathspec elements are
separated with NUL character and all other characters are taken
literally (including newlines and quotes).
File globbing matches across directory boundaries. Thus, given
two directories `d` and `d2`, there is a difference between
using `git rm 'd*'` and `git rm 'd/*'`, as the former will
also remove all of directory `d2`.
REMOVING FILES THAT HAVE DISAPPEARED FROM THE FILESYSTEM
--------------------------------------------------------
......
......@@ -15,6 +15,7 @@ SYNOPSIS
'git stash' branch <branchname> [<stash>]
'git stash' [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m|--message <message>]
[--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]]
'git stash' clear
'git stash' create [<message>]
......@@ -43,10 +44,10 @@ created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}`
is also possible). Stashes may also be referenced by specifying just the
stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
OPTIONS
-------
COMMANDS
--------
push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--] [<pathspec>...]::
push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
Save your local modifications to a new 'stash entry' and roll them
back to HEAD (in the working tree and in the index).
......@@ -56,38 +57,13 @@ push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q
For quickly making a snapshot, you can omit "push". In this mode,
non-option arguments are not allowed to prevent a misspelled
subcommand from making an unwanted stash entry. The two exceptions to this
are `stash -p` which acts as alias for `stash push -p` and pathspecs,
are `stash -p` which acts as alias for `stash push -p` and pathspec elements,
which are allowed after a double hyphen `--` for disambiguation.
+
When pathspec is given to 'git stash push', the new stash entry records the
modified states only for the files that match the pathspec. The index
entries and working tree files are then rolled back to the state in
HEAD only for these files, too, leaving files that do not match the
pathspec intact.
+
If the `--keep-index` option is used, all changes already added to the
index are left intact.
+
If the `--include-untracked` option is used, all untracked files are also
stashed and then cleaned up with `git clean`, leaving the working directory
in a very clean state. If the `--all` option is used instead then the
ignored files are stashed and cleaned in addition to the untracked files.
+
With `--patch`, you can interactively select hunks from the diff
between HEAD and the working tree to be stashed. The stash entry is
constructed such that its index state is the same as the index state
of your repository, and its worktree contains only the changes you
selected interactively. The selected changes are then rolled back
from your worktree. See the ``Interactive Mode'' section of
linkgit:git-add[1] to learn how to operate the `--patch` mode.
+
The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this.
save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [<message>]::
This option is deprecated in favour of 'git stash push'. It
differs from "stash push" in that it cannot take pathspecs.
differs from "stash push" in that it cannot take pathspec.
Instead, all non-option arguments are concatenated to form the stash
message.
......@@ -111,7 +87,7 @@ show [<options>] [<stash>]::
Show the changes recorded in the stash entry as a diff between the
stashed contents and the commit back when the stash entry was first
created. When no `<stash>` is given, it shows the latest one.
created.
By default, the command shows the diffstat, but it will accept any
format known to 'git diff' (e.g., `git stash show -p stash@{1}`
to view the second most recent entry in patch form).
......@@ -128,14 +104,6 @@ pop [--index] [-q|--quiet] [<stash>]::
Applying the state can fail with conflicts; in this case, it is not
removed from the stash list. You need to resolve the conflicts by hand
and call `git stash drop` manually afterwards.
+
If the `--index` option is used, then tries to reinstate not only the working
tree's changes, but also the index's ones. However, this can fail, when you
have conflicts (which are stored in the index, where you therefore can no
longer apply the changes as they were originally).
+
When no `<stash>` is given, `stash@{0}` is assumed, otherwise `<stash>` must
be a reference of the form `stash@{<revision>}`.
apply [--index] [-q|--quiet] [<stash>]::
......@@ -149,8 +117,7 @@ branch <branchname> [<stash>]::
the commit at which the `<stash>` was originally created, applies the
changes recorded in `<stash>` to the new working tree and index.
If that succeeds, and `<stash>` is a reference of the form
`stash@{<revision>}`, it then drops the `<stash>`. When no `<stash>`
is given, applies the latest one.
`stash@{<revision>}`, it then drops the `<stash>`.
+
This is useful if the branch on which you ran `git stash push` has
changed enough that `git stash apply` fails due to conflicts. Since
......@@ -166,9 +133,6 @@ clear::
drop [-q|--quiet] [<stash>]::
Remove a single stash entry from the list of stash entries.
When no `<stash>` is given, it removes the latest one.
i.e. `stash@{0}`, otherwise `<stash>` must be a valid stash
log reference of the form `stash@{<revision>}`.
create::
......@@ -185,6 +149,98 @@ store::
reflog. This is intended to be useful for scripts. It is
probably not the command you want to use; see "push" above.
OPTIONS
-------
-a::
--all::
This option is only valid for `push` and `save` commands.
+
All ignored and untracked files are also stashed and then cleaned
up with `git clean`.
-u::
--include-untracked::
This option is only valid for `push` and `save` commands.
+
All untracked files are also stashed and then cleaned up with
`git clean`.
--index::
This option is only valid for `pop` and `apply` commands.
+
Tries to reinstate not only the working tree's changes, but also
the index's ones. However, this can fail, when you have conflicts
(which are stored in the index, where you therefore can no longer
apply the changes as they were originally).
-k::
--keep-index::
--no-keep-index::
This option is only valid for `push` and `save` commands.
+
All changes already added to the index are left intact.
-p::
--patch::
This option is only valid for `push` and `save` commands.
+
Interactively select hunks from the diff between HEAD and the
working tree to be stashed. The stash entry is constructed such
that its index state is the same as the index state of your
repository, and its worktree contains only the changes you selected
interactively. The selected changes are then rolled back from your
worktree. See the ``Interactive Mode'' section of linkgit:git-add[1]
to learn how to operate the `--patch` mode.
+
The `--patch` option implies `--keep-index`. You can use
`--no-keep-index` to override this.
--pathspec-from-file=<file>::
This option is only valid for `push` command.
+
Pathspec is passed in `<file>` instead of commandline args. If
`<file>` is exactly `-` then standard input is used. Pathspec
elements are separated by LF or CR/LF. Pathspec elements can be
quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
global `--literal-pathspecs`.
--pathspec-file-nul::
This option is only valid for `push` command.
+
Only meaningful with `--pathspec-from-file`. Pathspec elements are
separated with NUL character and all other characters are taken
literally (including newlines and quotes).
-q::
--quiet::
This option is only valid for `apply`, `drop`, `pop`, `push`,
`save`, `store` commands.
+
Quiet, suppress feedback messages.
\--::
This option is only valid for `push` command.
+
Separates pathspec from options for disambiguation purposes.
<pathspec>...::
This option is only valid for `push` command.
+
The new stash entry records the modified states only for the files
that match the pathspec. The index entries and working tree files
are then rolled back to the state in HEAD only for these files,
too, leaving files that do not match the pathspec intact.
+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
<stash>::
This option is only valid for `apply`, `branch`, `drop`, `pop`,
`show` commands.
+
A reference of the form `stash@{<revision>}`. When no `<stash>` is
given, the latest stash is assumed (that is, `stash@{0}`).
DISCUSSION
----------
......
......@@ -133,7 +133,7 @@ If you really want to remove a submodule from the repository and commit
that use linkgit:git-rm[1] instead. See linkgit:gitsubmodules[7] for removal
options.
update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [--] [<path>...]::
update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--] [<path>...]::
+
--
Update the registered submodules to match what the superproject
......@@ -229,7 +229,7 @@ As an example, the command below will show the path and currently
checked out commit for each submodule:
+
--------------
git submodule foreach 'echo $path `git rev-parse HEAD`'
git submodule foreach 'echo $sm_path `git rev-parse HEAD`'
--------------
sync [--recursive] [--] [<path>...]::
......@@ -430,6 +430,10 @@ options carefully.
Clone new submodules in parallel with as many jobs.
Defaults to the `submodule.fetchJobs` option.
--[no-]single-branch::
This option is only valid for the update command.
Clone only one branch during update: HEAD or one specified by --branch.
<path>...::
Paths to submodule(s). When specified this will restrict the command
to only operate on the submodules found at the specified paths.
......
......@@ -549,6 +549,22 @@ The untracked cache extension can be enabled by the
`core.untrackedCache` configuration variable (see
linkgit:git-config[1]).
NOTES
-----
Users often try to use the assume-unchanged and skip-worktree bits
to tell Git to ignore changes to files that are tracked. This does not
work as expected, since Git may still check working tree files against
the index when performing certain operations. In general, Git does not
provide a way to ignore changes to tracked files, so alternate solutions
are recommended.
For example, if the file you want to change is some sort of config file,
the repository can include a sample config file that can then be copied
into the ignored name and modified. The repository can even include a
script to treat the sample file as a template, modifying and copying it
automatically.
SEE ALSO
--------
linkgit:git-config[1],
......
......@@ -110,9 +110,23 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config
Do not pipe Git output into a pager.
--git-dir=<path>::
Set the path to the repository. This can also be controlled by
setting the `GIT_DIR` environment variable. It can be an absolute
path or relative path to current working directory.
Set the path to the repository (".git" directory). This can also be
controlled by setting the `GIT_DIR` environment variable. It can be
an absolute path or relative path to current working directory.
+
Specifying the location of the ".git" directory using this
option (or `GIT_DIR` environment variable) turns off the
repository discovery that tries to find a directory with
".git" subdirectory (which is how the repository and the
top-level of the working tree are discovered), and tells Git
that you are at the top level of the working tree. If you
are not at the top-level directory of the working tree, you
should tell Git where the top-level of the working tree is,
with the `--work-tree=<path>` option (or `GIT_WORK_TREE`
environment variable)
+
If you just want to run git as if it was started in `<path>` then use
`git -C <path>`.
--work-tree=<path>::
Set the path to the working tree. It can be an absolute path
......@@ -482,13 +496,36 @@ double-quotes and respecting backslash escapes. E.g., the value
Git Commits
~~~~~~~~~~~
`GIT_AUTHOR_NAME`::
The human-readable name used in the author identity when creating commit or
tag objects, or when writing reflogs. Overrides the `user.name` and
`author.name` configuration settings.
`GIT_AUTHOR_EMAIL`::
The email address used in the author identity when creating commit or
tag objects, or when writing reflogs. Overrides the `user.email` and
`author.email` configuration settings.
`GIT_AUTHOR_DATE`::
The date used for the author identity when creating commit or tag objects, or
when writing reflogs. See linkgit:git-commit[1] for valid formats.
`GIT_COMMITTER_NAME`::
The human-readable name used in the committer identity when creating commit or
tag objects, or when writing reflogs. Overrides the `user.name` and
`committer.name` configuration settings.
`GIT_COMMITTER_EMAIL`::
The email address used in the author identity when creating commit or
tag objects, or when writing reflogs. Overrides the `user.email` and
`committer.email` configuration settings.
`GIT_COMMITTER_DATE`::
'EMAIL'::
see linkgit:git-commit-tree[1]
The date used for the committer identity when creating commit or tag objects, or
when writing reflogs. See linkgit:git-commit[1] for valid formats.
`EMAIL`::
The email address used in the author and committer identities if no other
relevant environment variable or configuration setting has been set.
Git Diffs
~~~~~~~~~
......
......@@ -226,6 +226,7 @@ endif::git-rev-list[]
'%GF':: show the fingerprint of the key used to sign a signed commit
'%GP':: show the fingerprint of the primary key whose subkey was used
to sign a signed commit
'%GT':: show the trust level for the key used to sign a signed commit
'%gD':: reflog selector, e.g., `refs/stash@{1}` or `refs/stash@{2
minutes ago}`; the format follows the rules described for the
`-g` option. The portion before the `@` is the refname as
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment