X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=advice.c;h=01130e54e7b270df7f535fb815dba25ddb72ec1a;hb=HEAD;hp=65a07859f261e12e88d638a1f4546583e0133d4c;hpb=b52ab19d91015ebd6bebc83a82b2c3d64b948b36;p=git.git diff --git a/advice.c b/advice.c index 65a07859f..01130e54e 100644 --- a/advice.c +++ b/advice.c @@ -73,3 +73,17 @@ void NORETURN die_resolve_conflict(const char *me) error_resolve_conflict(me); die("Exiting because of an unresolved conflict."); } + +void detach_advice(const char *new_name) +{ + const char fmt[] = + "Note: checking out '%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" + "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"; + + fprintf(stderr, fmt, new_name); +}