Detached HEAD
Detached HEAD is a Git state where HEAD points straight to one commit instead of a branch name.
Another example
An investigator checks out tag v2.8.0 to reproduce a release problem at that exact commit. If new work must be kept, a branch is created first. Commits left behind in detached HEAD can become hard to find.
Main parts
- 01HEAD
- 02direct commit target
- 03missing branch ref
Use it when
Use this term when HEAD points directly to a commit for checking, building, or short-lived work.
Do not use it when
Do not continue important work until you create a branch or another lasting reference.
Name used in code
HEAD → commit (no branch ref) Before you ship
Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback.
Outcome: Use Detached HEAD to release or recover the change safely, with a clear record. User context: An investigator checks out tag v2.8.0 to reproduce a release problem at that exact commit. If new work must be kept, a branch is created first. Commits left behind in detached HEAD can become hard to find. Delivery concept or operation: Detached HEAD. Why it fits: Use this term when HEAD points directly to a commit for checking, building, or short-lived work. Do not use it when: Do not continue important work until you create a branch or another lasting reference. Delivery requirements: Name the code repository and target. List preconditions, changes, review and CI checks, conflict and data-loss risks, release order, and the rollback or recovery command. Repository safeguards: Keep unpublished work and a clear history. Do not run destructive steps without an explicit backup. Check the exact code diff and remote target before publishing. Acceptance criteria: Review the intended diff and pass all required checks. Keep the target version traceable. Practice failure recovery and keep published history clear. Evidence and limits (evidence boundary): It is official for that source. Other platforms or teams may use the term in another way. Unknowns to confirm: Repository, branch, team activity, release environment, approval owner, protected checks, and rollback target.
Check this request
Review the current use of Detached HEAD. Definition: Detached HEAD is a Git state where HEAD points straight to one commit instead of a branch name. Release checks: Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.