diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-01-08 18:46:28 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-08 13:40:42 -0800 |
commit | fe035523b7e03dc75c0ae086d897c9e5e6683624 (patch) | |
tree | 9268e29d6e67fb8aafd328921117050645c2b5a1 /advice.c | |
parent | 8c4a37b90815d4e17b2d2e50e9221fd59afd7d23 (diff) | |
download | git-nd/clone-detached.tar.gz |
clone: print advice on checking out detached HEADnd/clone-detached
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.c')
-rw-r--r-- | advice.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -64,3 +64,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); +} |