Repository navigation
pr-2250/jvns/detached-head-v1
tagged this
07 Oct 14:52
From: Julia Evans <julia@jvns.ca>
The current explanation has the following issues:
- Says detached HEAD state is useful but doesn't explain why
- Takes many paragraphs before explaining what detached HEAD state is
- It's common for users to accidentally end up in detached HEAD state,
but it doesn't explain why that might happen
- One of the UI improvements in `git switch` is to make it harder
to detach accidentally, but that isn't advertised.
See 7968bef06b (switch: only allow explicit detached HEAD, 2019-03-29)
- Too many confusing diagrams
Write a new explanation addressing these issues, and put it in a
standalone guide so that we can easily reference it from advice
("see `git help detachedhead`").
The result is a shorter guide that covers more material.
The framing that "Git considers commits that aren't on a branch/other
reference to be garbage" is taken from Steve Klabnik's tutorial
https://steveklabnik.github.io/jujutsu-tutorial/branching-merging-and-conflicts/anonymous-branches.html.
It's funny and it's consistent with the way Git uses the term
"garbage collection".
Co-authored-by: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com>
Signed-off-by: Julia Evans <julia@jvns.ca>
Submitted-As: https://lore.kernel.org/git/pull.2250.git.1791384721919.gitgitgadget@gmail.com