From d333f672aec553e892a93d6dd1082c543f31d2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 29 Mar 2019 17:38:53 +0700 Subject: git-checkout.txt: spell out --no-option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's easier to search for and also less cryptic. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index f179b43..99c8c0d 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -118,7 +118,8 @@ OPTIONS --quiet:: Quiet, suppress feedback messages. ---[no-]progress:: +--progress:: +--no-progress:: Progress status is reported on the standard error stream by default when it is attached to a terminal, unless `--quiet` is specified. This flag enables progress reporting even if not @@ -262,7 +263,7 @@ edits from your current working tree. See the ``Interactive Mode'' section of linkgit:git-add[1] to learn how to operate the `--patch` mode. + Note that this option uses the no overlay mode by default (see also -`--[no-]overlay`), and currently doesn't support overlay mode. +`--overlay`), and currently doesn't support overlay mode. --ignore-other-worktrees:: `git checkout` refuses when the wanted ref is already checked @@ -270,7 +271,8 @@ Note that this option uses the no overlay mode by default (see also out anyway. In other words, the ref can be held by more than one worktree. ---[no-]recurse-submodules:: +--recurse-submodules:: +--no-recurse-submodules:: Using --recurse-submodules will update the content of all initialized submodules according to the commit recorded in the superproject. If local modifications in a submodule would be overwritten the checkout @@ -283,7 +285,8 @@ Note that this option uses the no overlay mode by default (see also Do not attempt to create a branch if a remote tracking branch of the same name exists. ---[no-]overlay:: +--overlay:: +--no-overlay:: In the default overlay mode, `git checkout` never removes files from the index or the working tree. When specifying `--no-overlay`, files that appear in the index and -- cgit v0.10.2-6-g49f6 From 37f80025cdc5c2fe98039d45678f8ca9c7e36b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 29 Mar 2019 17:38:54 +0700 Subject: git-checkout.txt: fix one syntax line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can be omitted in this syntax, and it's actually documented a few paragraphs down: You could omit , in which case the command degenerates to "check out the current branch", which is a glorified no-op with rather expensive side-effects to show only the tracking information, if exists, for the current branch. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 99c8c0d..28817cf 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -23,7 +23,7 @@ or the specified tree. If no paths are given, 'git checkout' will also update `HEAD` to set the specified branch as the current branch. -'git checkout' :: +'git checkout' []:: To prepare for working on , switch to it by updating the index and the files in the working tree, and by pointing HEAD at the branch. Local modifications to the files in the -- cgit v0.10.2-6-g49f6 From 9d223d43e5270a194902e2916ac0995cc1ba4524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 29 Mar 2019 17:38:55 +0700 Subject: doc: document --overwrite-ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I added this option in git-checkout and git-merge in c1d7036b6b (checkout,merge: disallow overwriting ignored files with --no-overwrite-ignore - 2011-11-27) but did not remember to update documentation. This completes that commit. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 28817cf..5280d1f 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -271,6 +271,12 @@ Note that this option uses the no overlay mode by default (see also out anyway. In other words, the ref can be held by more than one worktree. +--overwrite-ignore:: +--no-overwrite-ignore:: + Silently overwrite ignored files when switching branches. This + is the default behavior. Use `--no-overwrite-ignore` to abort + the operation when the new branch contains ignored files. + --recurse-submodules:: --no-recurse-submodules:: Using --recurse-submodules will update the content of all initialized diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 4cc8646..6a9163d 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -87,6 +87,11 @@ will be appended to the specified message. Allow the rerere mechanism to update the index with the result of auto-conflict resolution if possible. +--overwrite-ignore:: +--no-overwrite-ignore:: + Silently overwrite ignored files from the merge result. This + is the default behavior. Use `--no-overwrite-ignore` to abort. + --abort:: Abort the current conflict resolution process, and try to reconstruct the pre-merge state. -- cgit v0.10.2-6-g49f6 From 181e3725ecd12f5477d8581515fdbeb2469df1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 29 Mar 2019 17:38:56 +0700 Subject: git-checkout.txt: fix monospace typeset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add backticks where we have none, replace single quotes with backticks and replace double-quotes. Drop double-quotes from nested constructions such as `"@{-1}"`. Helped-by: Martin Ågren Signed-off-by: Martin Ågren Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 5280d1f..bf90966 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -24,14 +24,14 @@ also update `HEAD` to set the specified branch as the current branch. 'git checkout' []:: - To prepare for working on , switch to it by updating + To prepare for working on ``, switch to it by updating the index and the files in the working tree, and by pointing - HEAD at the branch. Local modifications to the files in the + `HEAD` at the branch. Local modifications to the files in the working tree are kept, so that they can be committed to the - . + ``. + -If is not found but there does exist a tracking branch in -exactly one remote (call it ) with a matching name, treat as +If `` is not found but there does exist a tracking branch in +exactly one remote (call it ``) with a matching name, treat as equivalent to + ------------ @@ -47,7 +47,7 @@ branches from there if `` is ambiguous but exists on the 'origin' remote. See also `checkout.defaultRemote` in linkgit:git-config[1]. + -You could omit , in which case the command degenerates to +You could omit ``, in which case the command degenerates to "check out the current branch", which is a glorified no-op with rather expensive side-effects to show only the tracking information, if exists, for the current branch. @@ -61,7 +61,7 @@ if exists, for the current branch. `--track` without `-b` implies branch creation; see the description of `--track` below. + -If `-B` is given, is created if it doesn't exist; otherwise, it +If `-B` is given, `` is created if it doesn't exist; otherwise, it is reset. This is the transactional equivalent of + ------------ @@ -75,25 +75,25 @@ successful. 'git checkout' --detach []:: 'git checkout' [--detach] :: - Prepare to work on top of , by detaching HEAD at it + Prepare to work on top of ``, by detaching `HEAD` at it (see "DETACHED HEAD" section), and updating the index and the files in the working tree. Local modifications to the files in the working tree are kept, so that the resulting working tree will be the state recorded in the commit plus the local modifications. + -When the argument is a branch name, the `--detach` option can -be used to detach HEAD at the tip of the branch (`git checkout -` would check out that branch without detaching HEAD). +When the `` argument is a branch name, the `--detach` option can +be used to detach `HEAD` at the tip of the branch (`git checkout +` would check out that branch without detaching `HEAD`). + -Omitting detaches HEAD at the tip of the current branch. +Omitting `` detaches `HEAD` at the tip of the current branch. 'git checkout' [] [--] ...:: Overwrite paths in the working tree by replacing with the - contents in the index or in the (most often a - commit). When a is given, the paths that - match the are updated both in the index and in + contents in the index or in the `` (most often a + commit). When a `` is given, the paths that + match the `` are updated both in the index and in the working tree. + The index may contain unmerged entries because of a previous failed merge. @@ -128,7 +128,7 @@ OPTIONS -f:: --force:: When switching branches, proceed even if the index or the - working tree differs from HEAD. This is used to throw away + working tree differs from `HEAD`. This is used to throw away local changes. + When checking out paths from the index, do not fail upon unmerged @@ -155,12 +155,12 @@ on your side branch as `theirs` (i.e. "one contributor's work on top of it"). -b :: - Create a new branch named and start it at - ; see linkgit:git-branch[1] for details. + Create a new branch named `` and start it at + ``; see linkgit:git-branch[1] for details. -B :: - Creates the branch and start it at ; - if it already exists, then reset it to . This is + Creates the branch `` and start it at ``; + if it already exists, then reset it to ``. This is equivalent to running "git branch" with "-f"; see linkgit:git-branch[1] for details. @@ -173,15 +173,15 @@ If no `-b` option is given, the name of the new branch will be derived from the remote-tracking branch, by looking at the local part of the refspec configured for the corresponding remote, and then stripping the initial part up to the "*". -This would tell us to use "hack" as the local branch when branching -off of "origin/hack" (or "remotes/origin/hack", or even -"refs/remotes/origin/hack"). If the given name has no slash, or the above +This would tell us to use `hack` as the local branch when branching +off of `origin/hack` (or `remotes/origin/hack`, or even +`refs/remotes/origin/hack`). If the given name has no slash, or the above guessing results in an empty name, the guessing is aborted. You can explicitly give a name with `-b` in such a case. --no-track:: Do not set up "upstream" configuration, even if the - branch.autoSetupMerge configuration variable is true. + `branch.autoSetupMerge` configuration variable is true. -l:: Create the new branch's reflog; see linkgit:git-branch[1] for @@ -190,21 +190,21 @@ explicitly give a name with `-b` in such a case. --detach:: Rather than checking out a branch to work on it, check out a commit for inspection and discardable experiments. - This is the default behavior of "git checkout " when - is not a branch name. See the "DETACHED HEAD" section + This is the default behavior of `git checkout ` when + `` is not a branch name. See the "DETACHED HEAD" section below for details. --orphan :: - Create a new 'orphan' branch, named , started from - and switch to it. The first commit made on this + Create a new 'orphan' branch, named ``, started from + `` and switch to it. The first commit made on this new branch will have no parents and it will be the root of a new history totally disconnected from all the other branches and commits. + The index and the working tree are adjusted as if you had previously run -"git checkout ". This allows you to start a new history -that records a set of paths similar to by easily running -"git commit -a" to make the root commit. +`git checkout `. This allows you to start a new history +that records a set of paths similar to `` by easily running +`git commit -a` to make the root commit. + This can be useful when you want to publish the tree from a commit without exposing its full history. You might want to do this to publish @@ -213,17 +213,17 @@ whose full history contains proprietary or otherwise encumbered bits of code. + If you want to start a disconnected history that records a set of paths -that is totally different from the one of , then you should +that is totally different from the one of ``, then you should clear the index and the working tree right after creating the orphan -branch by running "git rm -rf ." from the top level of the working tree. +branch by running `git rm -rf .` from the top level of the working tree. Afterwards you will be ready to prepare your new files, repopulating the working tree, by copying them from elsewhere, extracting a tarball, etc. --ignore-skip-worktree-bits:: In sparse checkout mode, `git checkout -- ` would - update only entries matched by and sparse patterns - in $GIT_DIR/info/sparse-checkout. This option ignores - the sparse patterns and adds back any files in . + update only entries matched by `` and sparse patterns + in `$GIT_DIR/info/sparse-checkout`. This option ignores + the sparse patterns and adds back any files in ``. -m:: --merge:: @@ -245,18 +245,18 @@ When checking out paths from the index, this option lets you recreate the conflicted merge in the specified paths. --conflict=