Skip to content

Commit 1ca7786

Browse files
authored
Merge pull request #1492 from HonkingGoose/update-git-detached-head-help-message
Update Git's detached HEAD help message
2 parents 9ece3ec + 3dae5db commit 1ca7786

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

book/02-git-basics/sections/tagging.asc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,22 @@ If you want to view the versions of files a tag is pointing to, you can do a `gi
263263
[source,console]
264264
----
265265
$ git checkout v2.0.0
266-
Note: checking out 'v2.0.0'.
266+
Note: switching to 'v2.0.0'.
267267
268268
You are in 'detached HEAD' state. You can look around, make experimental
269269
changes and commit them, and you can discard any commits you make in this
270270
state without impacting any branches by performing another checkout.
271271
272272
If you want to create a new branch to retain commits you create, you may
273-
do so (now or later) by using -b with the checkout command again. Example:
273+
do so (now or later) by using -c with the switch command. Example:
274274
275-
git checkout -b <new-branch>
275+
git switch -c <new-branch-name>
276+
277+
Or undo this operation with:
278+
279+
git switch -
280+
281+
Turn off this advice by setting config variable advice.detachedHead to false
276282
277283
HEAD is now at 99ada87... Merge pull request #89 from schacon/appendix-final
278284

0 commit comments

Comments
 (0)