From 3dae5dbde8beed8b057acb9e72b170fba6f7d8ec Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 21 Aug 2020 10:39:34 +0200 Subject: [PATCH] Update Git's detached HEAD help message --- book/02-git-basics/sections/tagging.asc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/book/02-git-basics/sections/tagging.asc b/book/02-git-basics/sections/tagging.asc index 30c323938..92196f557 100644 --- a/book/02-git-basics/sections/tagging.asc +++ b/book/02-git-basics/sections/tagging.asc @@ -263,16 +263,22 @@ If you want to view the versions of files a tag is pointing to, you can do a `gi [source,console] ---- $ git checkout v2.0.0 -Note: checking out 'v2.0.0'. +Note: switching to 'v2.0.0'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may -do so (now or later) by using -b with the checkout command again. Example: +do so (now or later) by using -c with the switch command. Example: - git checkout -b + git switch -c + +Or undo this operation with: + + git switch - + +Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 99ada87... Merge pull request #89 from schacon/appendix-final