Merge branch 'nd/switch-and-restore'
[gitweb.git] / advice.c
index ce5f374ecd4917346145c8a380ac8c0e45e849a4..b04709bfec98df6df93d39ed773a95a6dd897c18 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -193,13 +193,22 @@ void NORETURN die_conclude_merge(void)
 void detach_advice(const char *new_name)
 {
        const char *fmt =
-       _("Note: checking out '%s'.\n\n"
+       _("Note: switching to '%s'.\n"
+       "\n"
        "You are in 'detached HEAD' state. You can look around, make experimental\n"
        "changes and commit them, and you can discard any commits you make in this\n"
-       "state without impacting any branches by performing another checkout.\n\n"
+       "state without impacting any branches by switching back to a branch.\n"
+       "\n"
        "If you want to create a new branch to retain commits you create, you may\n"
-       "do so (now or later) by using -b with the checkout command again. Example:\n\n"
-       "  git checkout -b <new-branch-name>\n\n");
+       "do so (now or later) by using -c with the switch command. Example:\n"
+       "\n"
+       "  git switch -c <new-branch-name>\n"
+       "\n"
+       "Or undo this operation with:\n"
+       "\n"
+       "  git switch -\n"
+       "\n"
+       "Turn off this advice by setting config variable advice.detachedHead to false\n\n");
 
        fprintf(stderr, fmt, new_name);
 }