Skip to content

Commit 355353e

Browse files
committed
doc: git-checkout: deduplicate --detach explanation
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 <[email protected]>
1 parent 382a491 commit 355353e

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
@@ -65,16 +65,9 @@ commit would overwrite your uncommitted changes.
6565
`git checkout --detach [<branch>]`::
6666
`git checkout [--detach] <commit>`::
6767
68-
Prepare to work on top of _<commit>_, by detaching `HEAD` at it
69-
(see "DETACHED HEAD" section), and updating the index and the
70-
files in the working tree. Local modifications to the files
71-
in the working tree are kept, so that the resulting working
72-
tree will be the state recorded in the commit plus the local
73-
modifications.
74-
+
75-
When the _<commit>_ argument is a branch name, the `--detach` option can
76-
be used to detach `HEAD` at the tip of the branch (`git checkout
77-
<branch>` would check out that branch without detaching `HEAD`).
68+
The same as `git checkout <branch>`, except that instead of pointing
69+
`HEAD` at the branch, it points `HEAD` at the commit ID.
70+
See the "DETACHED HEAD" section below for more.
7871
+
7972
Omitting _<branch>_ detaches `HEAD` at the tip of the current branch.
8073

0 commit comments

Comments
 (0)