MCPcopy Create free account
hub / github.com/git/git / detach_advice

Function detach_advice

advice.c:274–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void detach_advice(const char *new_name)
275{
276 const char *fmt =
277 _("Note: switching to '%s'.\n"
278 "\n"
279 "You are in 'detached HEAD' state. You can look around, make experimental\n"
280 "changes and commit them, and you can discard any commits you make in this\n"
281 "state without impacting any branches by switching back to a branch.\n"
282 "\n"
283 "If you want to create a new branch to retain commits you create, you may\n"
284 "do so (now or later) by using -c with the switch command. Example:\n"
285 "\n"
286 " git switch -c <new-branch-name>\n"
287 "\n"
288 "Or undo this operation with:\n"
289 "\n"
290 " git switch -\n"
291 "\n"
292 "Turn off this advice by setting config variable advice.detachedHead to false\n\n");
293
294 fprintf(stderr, fmt, new_name);
295}
296
297void advise_on_moving_dirty_path(struct string_list *pathspec_list)
298{

Callers 2

checkoutFunction · 0.85
update_refs_for_switchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected