From: Julia Evans via GitGitGadget Date: Wed, 03 Sep 2025 16:50:00 GMT Subject: [PATCH v3 4/6] doc: git-checkout: deduplicate --detach explanation Message-ID: <6ce31b62787694610138e052f3d4fcf6ebbcfddd.1756918202.git.gitgitgadget@gmail.com> In-Reply-To: From: Julia Evans Say that `git checkout --detach` is almost the same as `git checkout` instead of duplicating the content of the `git checkout` section, since many users will already be familiar with what `git checkout` does. Signed-off-by: Julia Evans --- Documentation/git-checkout.adoc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc index a2777fb5b0..d35fd32ce8 100644 --- a/Documentation/git-checkout.adoc +++ b/Documentation/git-checkout.adoc @@ -65,16 +65,9 @@ commit would overwrite your uncommitted changes. `git checkout --detach []`:: `git checkout [--detach] `:: - 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`). + The same as `git checkout `, except that instead of pointing + `HEAD` at the branch, it points `HEAD` at the commit ID. + See the "DETACHED HEAD" section below for more. + Omitting __ detaches `HEAD` at the tip of the current branch. -- gitgitgadget