From: Julia Evans via GitGitGadget Date: Mon, 25 Aug 2025 19:08:52 GMT Subject: [PATCH 4/5] doc: git-checkout: deduplicate --detach explanation Message-ID: <2221a6bfb508205b99bfe086b60e64c7218a2606.1756148933.git.gitgitgadget@gmail.com> In-Reply-To: From: Julia Evans Right now the explanation of `--detach` repeats a lot of the content in the description of `git checkout `: we can communicate the same thing by saying "This is the same as `git checkout `, except..." 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 dc9607d9ea39..b343d292b30b 100644 --- a/Documentation/git-checkout.adoc +++ b/Documentation/git-checkout.adoc @@ -73,16 +73,9 @@ that is, the branch will not be created or modified unless `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