Skip to content

Commit 6f3e485

Browse files
committed
doc: git-checkout: deduplicate --detach explanation
Right now the explanation of `--detach` repeats a lot of the content in the description of `git checkout <branch>`: we can communicate the same thing by saying "This is the same as `git checkout <branch>`, except..." Signed-off-by: Julia Evans <[email protected]>
1 parent 360051d commit 6f3e485

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Documentation/git-checkout.adoc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,9 @@ that is, the branch will not be created or modified unless
6969
`git checkout --detach [<branch>]`::
7070
`git checkout [--detach] <commit>`::
7171
72-
Prepare to work on top of _<commit>_, by detaching `HEAD` at it
73-
(see "DETACHED HEAD" section), and updating the index and the
74-
files in the working tree. Local modifications to the files
75-
in the working tree are kept, so that the resulting working
76-
tree will be the state recorded in the commit plus the local
77-
modifications.
78-
+
79-
When the _<commit>_ argument is a branch name, the `--detach` option can
80-
be used to detach `HEAD` at the tip of the branch (`git checkout
81-
<branch>` would check out that branch without detaching `HEAD`).
72+
The same as `git checkout <branch>`, except that instead of pointing
73+
`HEAD` at the branch, it points `HEAD` at the commit ID.
74+
See the "DETACHED HEAD" section below for more.
8275
+
8376
Omitting _<branch>_ detaches `HEAD` at the tip of the current branch.
8477

0 commit comments

Comments
 (0)