diff --git a/Documentation/config/stash.adoc b/Documentation/config/stash.adoc index e556105a15bd46..7fc32027f70cd4 100644 --- a/Documentation/config/stash.adoc +++ b/Documentation/config/stash.adoc @@ -1,19 +1,28 @@ -stash.index:: +ifndef::git-stash[] +:see-show: See the description of the 'show' command in linkgit:git-stash[1]. +endif::git-stash[] + +ifdef::git-stash[] +:see-show: +endif::git-stash[] + +`stash.index`:: If this is set to true, `git stash apply` and `git stash pop` will - behave as if `--index` was supplied. Defaults to false. See the - descriptions in linkgit:git-stash[1]. + behave as if `--index` was supplied. Defaults to false. +ifndef::git-stash[] +See the descriptions in linkgit:git-stash[1]. +endif::git-stash[] -stash.showIncludeUntracked:: +`stash.showIncludeUntracked`:: If this is set to true, the `git stash show` command will show - the untracked files of a stash entry. Defaults to false. See - the description of the 'show' command in linkgit:git-stash[1]. + the untracked files of a stash entry. Defaults to false. {see-show} -stash.showPatch:: +`stash.showPatch`:: If this is set to true, the `git stash show` command without an option will show the stash entry in patch form. Defaults to false. - See the description of the 'show' command in linkgit:git-stash[1]. + {see-show} -stash.showStat:: +`stash.showStat`:: If this is set to true, the `git stash show` command without an option will show a diffstat of the stash entry. Defaults to true. - See the description of the 'show' command in linkgit:git-stash[1]. + {see-show} diff --git a/Documentation/config/tag.adoc b/Documentation/config/tag.adoc index 5062a057ffc6f5..d878da98d40b74 100644 --- a/Documentation/config/tag.adoc +++ b/Documentation/config/tag.adoc @@ -1,17 +1,23 @@ -tag.forceSignAnnotated:: +`tag.forceSignAnnotated`:: A boolean to specify whether annotated tags created should be GPG signed. If `--annotate` is specified on the command line, it takes precedence over this option. -tag.sort:: - This variable controls the sort ordering of tags when displayed by - linkgit:git-tag[1]. Without the "--sort=" option provided, the - value of this variable will be used as the default. +`tag.sort`:: +ifdef::git-tag[] +This variable controls the sort ordering of tags when displayed by `git-tag`. +endif::git-tag[] +ifndef::git-tag[] +This variable controls the sort ordering of tags when displayed by +linkgit:git-tag[1]. +endif::git-tag[] +Without the `--sort=` option provided, the value of this variable will +be used as the default. -tag.gpgSign:: +`tag.gpgSign`:: A boolean to specify whether all tags should be GPG signed. Use of this option when running in an automated script can result in a large number of tags being signed. It is therefore - convenient to use an agent to avoid typing your gpg passphrase + convenient to use an agent to avoid typing your GPG passphrase several times. Note that this option doesn't affect tag signing - behavior enabled by "-u " or "--local-user=" options. + behavior enabled by `-u ` or `--local-user=` options. diff --git a/Documentation/config/worktree.adoc b/Documentation/config/worktree.adoc index 9e3f84f748c4aa..a248076ea50bd5 100644 --- a/Documentation/config/worktree.adoc +++ b/Documentation/config/worktree.adoc @@ -1,4 +1,4 @@ -worktree.guessRemote:: +`worktree.guessRemote`:: If no branch is specified and neither `-b` nor `-B` nor `--detach` is used, then `git worktree add` defaults to creating a new branch from HEAD. If `worktree.guessRemote` is @@ -6,14 +6,14 @@ worktree.guessRemote:: branch whose name uniquely matches the new branch name. If such a branch exists, it is checked out and set as "upstream" for the new branch. If no such match can be found, it falls - back to creating a new branch from the current HEAD. + back to creating a new branch from the current `HEAD`. -worktree.useRelativePaths:: - Link worktrees using relative paths (when "true") or absolute - paths (when "false"). This is particularly useful for setups +`worktree.useRelativePaths`:: + Link worktrees using relative paths (when "`true`") or absolute + paths (when "`false`"). This is particularly useful for setups where the repository and worktrees may be moved between - different locations or environments. Defaults to "false". + different locations or environments. Defaults to "`false`". + -Note that setting `worktree.useRelativePaths` to "true" implies enabling the +Note that setting `worktree.useRelativePaths` to "`true`" implies enabling the `extensions.relativeWorktrees` config (see linkgit:git-config[1]), thus making it incompatible with older versions of Git. diff --git a/Documentation/git-stash.adoc b/Documentation/git-stash.adoc index e2300a19a2c0a3..235d57ddd8f5d1 100644 --- a/Documentation/git-stash.adoc +++ b/Documentation/git-stash.adoc @@ -7,24 +7,24 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- -[verse] -'git stash' list [] -'git stash' show [-u | --include-untracked | --only-untracked] [] [] -'git stash' drop [-q | --quiet] [] -'git stash' pop [--index] [-q | --quiet] [] -'git stash' apply [--index] [-q | --quiet] [] -'git stash' branch [] -'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] +[synopsis] +git stash list [] +git stash show [-u | --include-untracked | --only-untracked] [] [] +git stash drop [-q | --quiet] [] +git stash pop [--index] [-q | --quiet] [] +git stash apply [--index] [-q | --quiet] [] +git stash branch [] +git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] [-u | --include-untracked] [-a | --all] [(-m | --message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]] -'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] - [-u | --include-untracked] [-a | --all] [] -'git stash' clear -'git stash' create [] -'git stash' store [(-m | --message) ] [-q | --quiet] -'git stash' export (--print | --to-ref ) [...] -'git stash' import +git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] + [-u | --include-untracked] [-a | --all] [] +git stash clear +git stash create [] +git stash store [(-m | --message) ] [-q | --quiet] +git stash export (--print | --to-ref ) [...] +git stash import DESCRIPTION ----------- @@ -38,7 +38,7 @@ The modifications stashed away by this command can be listed with `git stash list`, inspected with `git stash show`, and restored (potentially on top of a different commit) with `git stash apply`. Calling `git stash` without any arguments is equivalent to `git stash push`. -A stash is by default listed as "WIP on 'branchname' ...", but +A stash is by default listed as "WIP on '' ...", but you can give a more descriptive message on the command line when you create one. @@ -47,16 +47,16 @@ stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. `stash@{0}` is the most recently 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}`). +stash index (e.g. the integer `` is equivalent to `stash@{}`). COMMANDS -------- -push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [(-m|--message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]:: +`push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-u | --include-untracked] [ -a | --all] [-q | --quiet] [(-m|--message) ] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...]`:: Save your local modifications to a new 'stash entry' and roll them - back to HEAD (in the working tree and in the index). - The part is optional and gives + back to `HEAD` (in the working tree and in the index). + The __ part is optional and gives the description along with the stashed state. + For quickly making a snapshot, you can omit "push". In this mode, @@ -65,14 +65,14 @@ subcommand from making an unwanted stash entry. The two exceptions to this are `stash -p` which acts as alias for `stash push -p` and pathspec elements, which are allowed after a double hyphen `--` for disambiguation. -save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] []:: +`save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-u | --include-untracked] [-a | --all] [-q | --quiet] []`:: This option is deprecated in favour of 'git stash push'. It differs from "stash push" in that it cannot take pathspec. Instead, all non-option arguments are concatenated to form the stash message. -list []:: +`list []`:: List the stash entries that you currently have. Each 'stash entry' is listed with its name (e.g. `stash@{0}` is the latest entry, `stash@{1}` is @@ -88,7 +88,7 @@ stash@{1}: On master: 9cc0589... Add git-stash The command takes options applicable to the 'git log' command to control what is shown and how. See linkgit:git-log[1]. -show [-u|--include-untracked|--only-untracked] [] []:: +`show [-u | --include-untracked | --only-untracked] [] []`:: 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 @@ -96,12 +96,12 @@ show [-u|--include-untracked|--only-untracked] [] []:: 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). - If no `` is provided, the default behavior will be given + If no __ is provided, the default behavior will be given by the `stash.showStat`, and `stash.showPatch` config variables. You can also use `stash.showIncludeUntracked` to set whether `--include-untracked` is enabled by default. -pop [--index] [-q|--quiet] []:: +`pop [--index] [-q | --quiet] []`:: Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse @@ -112,19 +112,19 @@ 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. -apply [--index] [-q|--quiet] []:: +`apply [--index] [-q | --quiet] []`:: Like `pop`, but do not remove the state from the stash list. Unlike `pop`, `` may be any commit that looks like a commit created by `stash push` or `stash create`. -branch []:: +`branch []`:: - Creates and checks out a new branch named `` starting from - the commit at which the `` was originally created, applies the - changes recorded in `` to the new working tree and index. - If that succeeds, and `` is a reference of the form - `stash@{}`, it then drops the ``. + Creates and checks out a new branch named __ starting from + the commit at which the __ was originally created, applies the + changes recorded in __ to the new working tree and index. + If that succeeds, and __ is a reference of the form + `stash@{}`, it then drops the __. + 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 @@ -132,54 +132,51 @@ the stash entry is applied on top of the commit that was HEAD at the time `git stash` was run, it restores the originally stashed state with no conflicts. -clear:: +`clear`:: Remove all the stash entries. Note that those entries will then be subject to pruning, and may be impossible to recover (see - 'Examples' below for a possible strategy). - -drop [-q|--quiet] []:: + 'EXAMPLES' below for a possible strategy). +`drop [-q | --quiet] []`:: Remove a single stash entry from the list of stash entries. -create:: - +`create`:: Create a stash entry (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. -store:: +`store`:: Store a given stash created via 'git stash create' (which is a dangling merge commit) in the stash ref, updating the stash reflog. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. -export ( --print | --to-ref ) [...]:: +`export ( --print | --to-ref ) [...]`:: Export the specified stashes, or all of them if none are specified, to a chain of commits which can be transferred using the normal fetch and push mechanisms, then imported using the `import` subcommand. -import :: - +`import `:: Import the specified stashes from the specified commit, which must have been created by `export`, and add them to the list of stashes. To replace the existing stashes, use `clear` first. OPTIONS ------- --a:: ---all:: +`-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:: ---no-include-untracked:: +`-u`:: +`--include-untracked`:: +`--no-include-untracked`:: When used with the `push` and `save` commands, all untracked files are also stashed and then cleaned up with `git clean`. @@ -187,12 +184,12 @@ up with `git clean`. When used with the `show` command, show the untracked files in the stash entry as part of the diff. ---only-untracked:: +`--only-untracked`:: This option is only valid for the `show` command. + Show only the untracked files in the stash entry as part of the diff. ---index:: +`--index`:: This option is only valid for `pop` and `apply` commands. + Tries to reinstate not only the working tree's changes, but also @@ -200,15 +197,15 @@ 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:: +`-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:: +`-p`:: +`--patch`:: This option is only valid for `push` and `save` commands. + Interactively select hunks from the diff between HEAD and the @@ -224,8 +221,8 @@ The `--patch` option implies `--keep-index`. You can use include::diff-context-options.adoc[] --S:: ---staged:: +`-S`:: +`--staged`:: This option is only valid for `push` and `save` commands. + Stash only the changes that are currently staged. This is similar to @@ -234,49 +231,49 @@ of current branch. + The `--patch` option has priority over this one. ---pathspec-from-file=:: +`--pathspec-from-file=`:: This option is only valid for `push` command. + -Pathspec is passed in `` instead of commandline args. If -`` is exactly `-` then standard input is used. Pathspec +Pathspec is passed in __ instead of commandline args. If +__ 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:: +`--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:: +`-q`:: +`--quiet`:: This option is only valid for `apply`, `drop`, `pop`, `push`, `save`, `store` commands. + Quiet, suppress feedback messages. ---print:: +`--print`:: This option is only valid for the `export` command. + Create the chain of commits representing the exported stashes without storing it anywhere in the ref namespace and print the object ID to standard output. This is designed for scripts. ---to-ref:: +`--to-ref`:: This option is only valid for the `export` command. + Create the chain of commits representing the exported stashes and store it to the specified ref. -\--:: +`--`:: This option is only valid for `push` command. + Separates pathspec from options for disambiguation purposes. -...:: +`...`:: This option is only valid for `push` command. + The new stash entry records the modified states only for the files @@ -286,11 +283,11 @@ too, leaving files that do not match the pathspec intact. + For more details, see the 'pathspec' entry in linkgit:gitglossary[7]. -:: +__:: This option is only valid for `apply`, `branch`, `drop`, `pop`, `show`, and `export` commands. + -A reference of the form `stash@{}`. When no `` is +A reference of the form `stash@{}`. When no __ is given, the latest stash is assumed (that is, `stash@{0}`). DISCUSSION @@ -419,6 +416,7 @@ CONFIGURATION include::includes/cmd-config-section-all.adoc[] +:git-stash: 1 include::config/stash.adoc[] diff --git a/Documentation/git-tag.adoc b/Documentation/git-tag.adoc index a4b1c0ec05a6c9..0f7badc11690af 100644 --- a/Documentation/git-tag.adoc +++ b/Documentation/git-tag.adoc @@ -8,21 +8,21 @@ git-tag - Create, list, delete or verify a tag object signed with GPG SYNOPSIS -------- -[verse] -'git tag' [-a | -s | -u ] [-f] [-m | -F ] [-e] +[synopsis] +git tag [-a | -s | -u ] [-f] [-m | -F ] [-e] [(--trailer [(=|:)])...] [ | ] -'git tag' -d ... -'git tag' [-n[]] -l [--contains ] [--no-contains ] +git tag -d ... +git tag [-n[]] -l [--contains ] [--no-contains ] [--points-at ] [--column[=] | --no-column] [--create-reflog] [--sort=] [--format=] [--merged ] [--no-merged ] [...] -'git tag' -v [--format=] ... +git tag -v [--format=] ... DESCRIPTION ----------- -Add a tag reference in `refs/tags/`, unless `-d/-l/-v` is given +Add a tag reference in `refs/tags/`, unless `-d`/`-l`/`-v` is given to delete, list or verify tags. Unless `-f` is given, the named tag must not yet exist. @@ -58,129 +58,129 @@ lightweight tags by default. OPTIONS ------- --a:: ---annotate:: +`-a`:: +`--annotate`:: Make an unsigned, annotated tag object --s:: ---sign:: +`-s`:: +`--sign`:: Make a GPG-signed tag, using the default e-mail address's key. The default behavior of tag GPG-signing is controlled by `tag.gpgSign` configuration variable if it exists, or disabled otherwise. See linkgit:git-config[1]. ---no-sign:: +`--no-sign`:: Override `tag.gpgSign` configuration variable that is set to force each and every tag to be signed. --u :: ---local-user=:: +`-u `:: +`--local-user=`:: Make a GPG-signed tag, using the given key. --f:: ---force:: +`-f`:: +`--force`:: Replace an existing tag with the given name (instead of failing) --d:: ---delete:: +`-d`:: +`--delete`:: Delete existing tags with the given names. --v:: ---verify:: +`-v`:: +`--verify`:: Verify the GPG signature of the given tag names. --n:: - specifies how many lines from the annotation, if any, - are printed when using -l. Implies `--list`. +`-n`:: + __ specifies how many lines from the annotation, if any, + are printed when using `-l`. Implies `--list`. + The default is not to print any annotation lines. If no number is given to `-n`, only the first line is printed. If the tag is not annotated, the commit message is displayed instead. --l:: ---list:: +`-l`:: +`--list`:: List tags. With optional `...`, e.g. `git tag --list 'v-*'`, list only the tags that match the pattern(s). + -Running "git tag" without arguments also lists all tags. The pattern -is a shell wildcard (i.e., matched using fnmatch(3)). Multiple +Running `git tag` without arguments also lists all tags. The pattern +is a shell wildcard (i.e., matched using `fnmatch`(3)). Multiple patterns may be given; if any of them matches, the tag is shown. + This option is implicitly supplied if any other list-like option such as `--contains` is provided. See the documentation for each of those options for details. ---sort=:: +`--sort=`:: Sort based on the key given. Prefix `-` to sort in - descending order of the value. You may use the --sort= option - multiple times, in which case the last key becomes the primary - key. Also supports "version:refname" or "v:refname" (tag - names are treated as versions). The "version:refname" sort - order can also be affected by the "versionsort.suffix" + descending order of the value. You may use the `--sort=` option + multiple times, in which case the last __ becomes the primary + key. Also supports "`version:refname`" or "`v:refname`" (tag + names are treated as versions). The "`version:refname`" sort + order can also be affected by the "`versionsort.suffix`" configuration variable. The keys supported are the same as those in `git for-each-ref`. Sort order defaults to the value configured for the `tag.sort` variable if it exists, or lexicographic order otherwise. See linkgit:git-config[1]. ---color[=]:: +`--color[=]`:: Respect any colors specified in the `--format` option. The - `` field must be one of `always`, `never`, or `auto` (if - `` is absent, behave as if `always` was given). + __ field must be one of `always`, `never`, or `auto` (if + __ is absent, behave as if `always` was given). --i:: ---ignore-case:: +`-i`:: +`--ignore-case`:: Sorting and filtering tags are case insensitive. ---omit-empty:: +`--omit-empty`:: Do not print a newline after formatted refs where the format expands to the empty string. ---column[=]:: ---no-column:: +`--column[=]`:: +`--no-column`:: Display tag listing in columns. See configuration variable `column.tag` for option syntax. `--column` and `--no-column` - without options are equivalent to 'always' and 'never' respectively. + without options are equivalent to `always` and `never` respectively. + This option is only applicable when listing tags without annotation lines. ---contains []:: - Only list tags which contain the specified commit (HEAD if not +`--contains []`:: + Only list tags which contain __ (`HEAD` if not specified). Implies `--list`. ---no-contains []:: - Only list tags which don't contain the specified commit (HEAD if +`--no-contains []`:: + Only list tags which don't contain __ (`HEAD` if not specified). Implies `--list`. ---merged []:: - Only list tags whose commits are reachable from the specified - commit (`HEAD` if not specified). +`--merged []`:: + Only list tags whose commits are reachable from + __ (`HEAD` if not specified). ---no-merged []:: - Only list tags whose commits are not reachable from the specified - commit (`HEAD` if not specified). +`--no-merged []`:: + Only list tags whose commits are not reachable from + __ (`HEAD` if not specified). ---points-at :: - Only list tags of the given object (HEAD if not +`--points-at []`:: + Only list tags of __ (`HEAD` if not specified). Implies `--list`. --m :: ---message=:: - Use the given tag message (instead of prompting). +`-m `:: +`--message=`:: + Use __ (instead of prompting). If multiple `-m` options are given, their values are concatenated as separate paragraphs. Implies `-a` if none of `-a`, `-s`, or `-u ` is given. --F :: ---file=:: - Take the tag message from the given file. Use '-' to +`-F `:: +`--file=`:: + Take the tag message from __. Use `-` to read the message from the standard input. Implies `-a` if none of `-a`, `-s`, or `-u ` is given. ---trailer [(=|:)]:: - Specify a (, ) pair that should be applied as a +`--trailer [(=|:)]`:: + Specify a (__, __) pair that should be applied as a trailer. (e.g. `git tag --trailer "Custom-Key: value"` will add a "Custom-Key" trailer to the tag message.) The `trailer.*` configuration variables @@ -190,46 +190,45 @@ This option is only applicable when listing tags without annotation lines. The trailers can be extracted in `git tag --list`, using `--format="%(trailers)"` placeholder. --e:: ---edit:: - The message taken from file with `-F` and command line with - `-m` are usually used as the tag message unmodified. - This option lets you further edit the message taken from these sources. +`-e`:: +`--edit`:: + Let further edit the message taken from file with `-F` and command line with + `-m`. ---cleanup=:: - This option sets how the tag message is cleaned up. - The '' can be one of 'verbatim', 'whitespace' and 'strip'. The - 'strip' mode is default. The 'verbatim' mode does not change message at - all, 'whitespace' removes just leading/trailing whitespace lines and - 'strip' removes both whitespace and commentary. +`--cleanup=`:: + Set how the tag message is cleaned up. + The __ can be one of `verbatim`, `whitespace` and `strip`. The + `strip` mode is default. The `verbatim` mode does not change message at + all, `whitespace` removes just leading/trailing whitespace lines and + `strip` removes both whitespace and commentary. ---create-reflog:: +`--create-reflog`:: Create a reflog for the tag. To globally enable reflogs for tags, see `core.logAllRefUpdates` in linkgit:git-config[1]. The negated form `--no-create-reflog` only overrides an earlier `--create-reflog`, but currently does not negate the setting of `core.logAllRefUpdates`. ---format=:: +`--format=`:: A string that interpolates `%(fieldname)` from a tag ref being shown and the object it points at. The format is the same as that of linkgit:git-for-each-ref[1]. When unspecified, defaults to `%(refname:strip=2)`. -:: +__:: The name of the tag to create, delete, or describe. The new tag name must pass all checks defined by linkgit:git-check-ref-format[1]. Some of these checks may restrict the characters allowed in a tag name. -:: -:: +__:: +__:: The object that the new tag will refer to, usually a commit. - Defaults to HEAD. + Defaults to `HEAD`. CONFIGURATION ------------- -By default, 'git tag' in sign-with-default mode (-s) will use your +By default, `git tag` in sign-with-default mode (`-s`) will use your committer identity (of the form `Your Name `) to find a key. If you want to use a different default key, you can specify it in the repository configuration as follows: @@ -252,7 +251,7 @@ On Re-tagging What should you do when you tag a wrong commit and you would want to re-tag? -If you never pushed anything out, just re-tag it. Use "-f" to +If you never pushed anything out, just re-tag it. Use `-f` to replace the old one. And you're done. But if you have pushed things out (or others could just read @@ -268,12 +267,12 @@ the old tag. In that case you can do one of two things: . The insane thing. You really want to call the new version "X" too, 'even though' - others have already seen the old one. So just use 'git tag -f' + others have already seen the old one. So just use `git tag -f` again, as if you hadn't already published the old one. However, Git does *not* (and it should not) change tags behind users back. So if somebody already got the old tag, doing a -'git pull' on your tree shouldn't just make them overwrite the old +`git pull` on your tree shouldn't just make them overwrite the old one. If somebody got a release tag from you, you cannot just change @@ -325,7 +324,7 @@ private anchor point tags from the other person. Often, "please pull" messages on the mailing list just provide two pieces of information: a repo URL and a branch name; this -is designed to be easily cut&pasted at the end of a 'git fetch' +is designed to be easily cut&pasted at the end of a `git fetch` command line: ------------ @@ -403,6 +402,14 @@ FILES user in an editor session will be available in this file, but may be overwritten by the next invocation of `git tag`. +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +:git-tag: 1 +include::config/tag.adoc[] + NOTES ----- diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc index 389e669ac044de..f272f797837f45 100644 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@ -8,16 +8,16 @@ git-worktree - Manage multiple working trees SYNOPSIS -------- -[verse] -'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason ]] - [--orphan] [(-b | -B) ] [] -'git worktree list' [-v | --porcelain [-z]] -'git worktree lock' [--reason ] -'git worktree move' -'git worktree prune' [-n] [-v] [--expire ] -'git worktree remove' [-f] -'git worktree repair' [...] -'git worktree unlock' +[synopsis] +git worktree add [-f] [--detach] [--checkout] [--lock [--reason ]] + [--orphan] [(-b | -B) ] [] +git worktree list [-v | --porcelain [-z]] +git worktree lock [--reason ] +git worktree move +git worktree prune [-n] [-v] [--expire ] +git worktree remove [-f] +git worktree repair [...] +git worktree unlock DESCRIPTION ----------- @@ -37,7 +37,7 @@ zero or more linked worktrees. When you are done with a linked worktree, remove it with `git worktree remove`. In its simplest form, `git worktree add ` automatically creates a -new branch whose name is the final component of ``, which is +new branch whose name is the final component of __, which is convenient if you plan to work on a new topic. For instance, `git worktree add ../hotfix` creates new branch `hotfix` and checks it out at path `../hotfix`. To instead work on an existing branch in a new worktree, @@ -63,16 +63,16 @@ locked. COMMANDS -------- -add []:: +`add []`:: -Create a worktree at `` and checkout `` into it. The new worktree +Create a worktree at __ and checkout __ into it. The new worktree is linked to the current repository, sharing everything except per-worktree -files such as `HEAD`, `index`, etc. As a convenience, `` may +files such as `HEAD`, `index`, etc. As a convenience, __ may be a bare "`-`", which is synonymous with `@{-1}`. + -If `` is a branch name (call it ``) and is not found, +If __ is a branch name (call it __) and is not found, and neither `-b` nor `-B` nor `--detach` are used, but there does -exist a tracking branch in exactly one remote (call it ``) +exist a tracking branch in exactly one remote (call it __) with a matching name, treat as equivalent to: + ------------ @@ -81,32 +81,32 @@ $ git worktree add --track -b / + If the branch exists in multiple remotes and one of them is named by the `checkout.defaultRemote` configuration variable, we'll use that -one for the purposes of disambiguation, even if the `` isn't +one for the purposes of disambiguation, even if the __ isn't unique across all remotes. Set it to e.g. `checkout.defaultRemote=origin` to always checkout remote -branches from there if `` is ambiguous but exists on the +branches from there if __ is ambiguous but exists on the `origin` remote. See also `checkout.defaultRemote` in linkgit:git-config[1]. + -If `` is omitted and neither `-b` nor `-B` nor `--detach` used, +If __ is omitted and neither `-b` nor `-B` nor `--detach` used, then, as a convenience, the new worktree is associated with a branch (call -it ``) named after `$(basename )`. If `` doesn't +it __) named after `$(basename )`. If __ doesn't exist, a new branch based on `HEAD` is automatically created as if -`-b ` was given. If `` does exist, it will be checked out +`-b ` was given. If __ does exist, it will be checked out in the new worktree, if it's not checked out anywhere else, otherwise the command will refuse to create the worktree (unless `--force` is used). + -If `` is omitted, neither `--detach`, or `--orphan` is +If __ is omitted, neither `--detach`, or `--orphan` is used, and there are no valid local branches (or remote branches if `--guess-remote` is specified) then, as a convenience, the new worktree is -associated with a new unborn branch named `` (after +associated with a new unborn branch named __ (after `$(basename )` if neither `-b` or `-B` is used) as if `--orphan` was passed to the command. In the event the repository has a remote and `--guess-remote` is used, but no remote or local branches exist, then the command fails with a warning reminding the user to fetch from their remote first (or override by using `-f/--force`). -list:: +`list`:: List details of each worktree. The main worktree is listed first, followed by each of the linked worktrees. The output details include @@ -115,32 +115,32 @@ branch currently checked out (or "detached HEAD" if none), "locked" if the worktree is locked, "prunable" if the worktree can be pruned by the `prune` command. -lock:: +`lock`:: If a worktree is on a portable device or network share which is not always mounted, lock it to prevent its administrative files from being pruned automatically. This also prevents it from being moved or deleted. Optionally, specify a reason for the lock with `--reason`. -move:: +`move`:: Move a worktree to a new location. Note that the main worktree or linked worktrees containing submodules cannot be moved with this command. (The `git worktree repair` command, however, can reestablish the connection with linked worktrees if you move the main worktree manually.) -prune:: +`prune`:: Prune worktree information in `$GIT_DIR/worktrees`. -remove:: +`remove`:: Remove a worktree. Only clean worktrees (no untracked files and no modification in tracked files) can be removed. Unclean worktrees or ones with submodules can be removed with `--force`. The main worktree cannot be removed. -repair [...]:: +`repair [...]`:: Repair worktree administrative files, if possible, if they have become corrupted or outdated due to external factors. @@ -154,72 +154,72 @@ Similarly, if the working tree for a linked worktree is moved without using `git worktree move`, the main worktree (or bare repository) will be unable to locate it. Running `repair` within the recently-moved worktree will reestablish the connection. If multiple linked worktrees are moved, -running `repair` from any worktree with each tree's new `` as an +running `repair` from any worktree with each tree's new __ as an argument, will reestablish the connection to all the specified paths. + If both the main worktree and linked worktrees have been moved or copied manually, -then running `repair` in the main worktree and specifying the new `` +then running `repair` in the main worktree and specifying the new __ of each linked worktree will reestablish all connections in both directions. -unlock:: +`unlock`:: Unlock a worktree, allowing it to be pruned, moved or deleted. OPTIONS ------- --f:: ---force:: +`-f`:: +`--force`:: By default, `add` refuses to create a new worktree when - `` is a branch name and is already checked out by - another worktree, or if `` is already assigned to some - worktree but is missing (for instance, if `` was deleted + __ is a branch name and is already checked out by + another worktree, or if __ is already assigned to some + worktree but is missing (for instance, if __ was deleted manually). This option overrides these safeguards. To add a missing but locked worktree path, specify `--force` twice. + `move` refuses to move a locked worktree unless `--force` is specified twice. If the destination is already assigned to some other worktree but is -missing (for instance, if `` was deleted manually), then `--force` +missing (for instance, if __ was deleted manually), then `--force` allows the move to proceed; use `--force` twice if the destination is locked. + `remove` refuses to remove an unclean worktree unless `--force` is used. To remove a locked worktree, specify `--force` twice. --b :: --B :: - With `add`, create a new branch named `` starting at - ``, and check out `` into the new worktree. - If `` is omitted, it defaults to `HEAD`. +`-b `:: +`-B `:: + With `add`, create a new branch named __ starting at + __, and check out __ into the new worktree. + If __ is omitted, it defaults to `HEAD`. By default, `-b` refuses to create a new branch if it already - exists. `-B` overrides this safeguard, resetting `` to - ``. + exists. `-B` overrides this safeguard, resetting __ to + __. --d:: ---detach:: +`-d`:: +`--detach`:: With `add`, detach `HEAD` in the new worktree. See "DETACHED HEAD" in linkgit:git-checkout[1]. ---checkout:: ---no-checkout:: - By default, `add` checks out ``, however, `--no-checkout` can +`--checkout`:: +`--no-checkout`:: + By default, `add` checks out __, however, `--no-checkout` can be used to suppress checkout in order to make customizations, such as configuring sparse-checkout. See "Sparse checkout" in linkgit:git-read-tree[1]. ---guess-remote:: ---no-guess-remote:: - With `worktree add `, without ``, instead +`--guess-remote`:: +`--no-guess-remote`:: + With `worktree add `, without __, instead of creating a new branch from `HEAD`, if there exists a tracking - branch in exactly one remote matching the basename of ``, + branch in exactly one remote matching the basename of __, base the new branch on the remote-tracking branch, and mark the remote-tracking branch as "upstream" from the new branch. + This can also be set up as the default behaviour by using the `worktree.guessRemote` config option. ---relative-paths:: ---no-relative-paths:: +`--relative-paths`:: +`--no-relative-paths`:: Link worktrees using relative paths or absolute paths (default). Overrides the `worktree.useRelativePaths` config option, see linkgit:git-config[1]. @@ -227,60 +227,60 @@ This can also be set up as the default behaviour by using the With `repair`, the linking files will be updated if there's an absolute/relative mismatch, even if the links are correct. ---track:: ---no-track:: - When creating a new branch, if `` is a branch, +`--track`:: +`--no-track`:: + When creating a new branch, if __ is a branch, mark it as "upstream" from the new branch. This is the - default if `` is a remote-tracking branch. See + default if __ is a remote-tracking branch. See `--track` in linkgit:git-branch[1] for details. ---lock:: +`--lock`:: Keep the worktree locked after creation. This is the equivalent of `git worktree lock` after `git worktree add`, but without a race condition. --n:: ---dry-run:: +`-n`:: +`--dry-run`:: With `prune`, do not remove anything; just report what it would remove. ---orphan:: +`--orphan`:: With `add`, make the new worktree and index empty, associating - the worktree with a new unborn branch named ``. + the worktree with a new unborn branch named __. ---porcelain:: +`--porcelain`:: With `list`, output in an easy-to-parse format for scripts. This format will remain stable across Git versions and regardless of user configuration. It is recommended to combine this with `-z`. See below for details. --z:: - Terminate each line with a NUL rather than a newline when +`-z`:: + Terminate each line with a _NUL_ rather than a newline when `--porcelain` is specified with `list`. This makes it possible to parse the output when a worktree path contains a newline character. --q:: ---quiet:: +`-q`:: +`--quiet`:: With `add`, suppress feedback messages. --v:: ---verbose:: +`-v`:: +`--verbose`:: With `prune`, report all removals. + With `list`, output additional information about worktrees (see below). ---expire