# fatal: You are not currently on a branch. Use 'git rebase --onto' or 'git checkout' first.

- **ID:** `git/rebase-detached-head`
- **Domain:** git
- **Category:** user_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

User attempted to run git rebase while in detached HEAD state, which is disallowed because there is no branch to update.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.33.0 | active | — | — |
| git 2.38.0 | active | — | — |
| git 2.45.0 | active | — | — |

## Workarounds

1. **Create a branch from the current detached HEAD: 'git checkout -b temp-branch', then run rebase.** (95% success)
   ```
   Create a branch from the current detached HEAD: 'git checkout -b temp-branch', then run rebase.
   ```
2. **Use 'git rebase --onto <target> <upstream>' to rebase without needing a branch.** (70% success)
   ```
   Use 'git rebase --onto <target> <upstream>' to rebase without needing a branch.
   ```

## Dead Ends

- **** — Running 'git rebase <branch>' without checking out a branch first will still fail. (90% fail)
- **** — Using 'git rebase --continue' after a failed rebase in detached state will not resolve the issue. (80% fail)
