What this error means
Git found an unfinished rebase in your repository. You likely started a rebase, hit conflicts, and then tried another Git operation (e.g., rebase again, pull --rebase, merge, or switch branches). Git blocks the new action until you either finish or abort the current rebase.
Key idea: complete the current rebase with --continue or stop it with --abort.
Quickstart (most cases)
- Check status:
git status - Resolve conflicts in files, then stage them:
git add <file>... - Continue:
git rebase --continue - If you want to drop the conflicting commit:
git rebase --skip - If you want to cancel the rebase entirely:
git rebase --abort
Minimal working example (reproduce and fix)
# 1) Setup a sample repo with a conflict
mkdir demo-rebase && cd demo-rebase
git init -b main
printf "line1\n" > app.txt
git add app.txt && git commit -m "init: add app.txt"
git checkout -b feature
printf "feature change\n" >> app.txt
git commit -am "feat: append feature change"
git checkout main
printf "main change\n" >> app.txt
git commit -am "main: append main change"
# 2) Start a rebase that will conflict
# Rebasing feature onto main
git checkout feature
git rebase main # will report a conflict in app.txt
# 3) If you now try another rebase/pull, you’ll see the error
git pull --rebase # fatal: You have not concluded your rebase
# 4) Fix the rebase properly
# Open app.txt, resolve the conflict, then:
git add app.txt
git rebase --continue # finishes applying the remaining commits
# 5) Verify history
git log --oneline --graph --decorate --all
Example conflict file state (what you’ll edit):
<<<<<<< HEAD
main change
=======
feature change
>>>>>>> <commit-being-rebased>
Resolve it to the intended final content, save, then stage and continue.
Step-by-step resolution
- Inspect the state
- Run:
git status - Look for “You are currently rebasing” and a list of conflicted files.
- Identify the commit being applied
git statususually shows which commit is in progress.- Optional:
git show REBASE_HEADto inspect the patch that is being applied (if REBASE_HEAD exists).
- Resolve conflicts
- Open each conflicted file and decide the correct content.
- Remove conflict markers (<<<<<<<, =======, >>>>>>>).
- Stage each resolved file:
git add <file>
- Continue, skip, or abort
- Continue when all conflicts are resolved:
git rebase --continue - Skip the commit if you intentionally want to drop it:
git rebase --skip - Abort the rebase to return to the pre-rebase state:
git rebase --abort
- Verify and clean up
git log --oneline --graphto confirm the expected history.git statusshould no longer report a rebase in progress.
Common commands and when to use them
| Command | When to use |
|---|---|
| git status | See current rebase state and conflicts |
| git add <file> | Mark a conflict as resolved |
| git rebase --continue | Proceed after resolving conflicts |
| git rebase --skip | Drop the current commit being applied |
| git rebase --abort | Cancel the rebase and restore previous state |
DevOps-focused tips
- In CI/CD scripts, ensure a clean workspace before rebase:
git reset --hardandgit clean -ffdto avoid leftover state.- If a job can be interrupted mid-rebase, protect with:
git rebase --abort || truebefore new fetch/merge steps.
- Enable conflict reuse to speed repeated rebases:
git config rerere.enabled true. - Favor smaller rebases: rebase and push frequently to reduce conflict surface.
- For shared branches, coordinate with your team to avoid force-push surprises after rebase.
Diagnostics and recovery
- Show what’s conflicting:
git statuslists files. - See staged vs unstaged:
git diff(unstaged),git diff --staged(staged). - If you accidentally staged wrong content:
- Unstage:
git restore --staged <file>(orgit reset <file>) - Edit, then re-stage.
- Unstage:
- If you get stuck or the state looks wrong:
git rebase --abortto reset to pre-rebase.git reflogto find prior positions; recover withgit reset --hard <reflog-entry>if needed.
Pitfalls to avoid
- Running new Git operations mid-rebase: finish or abort first.
- Skipping without understanding the impact:
--skipdrops a commit; review withgit show REBASE_HEADfirst when possible. - Editing only some conflicts: all conflicted files must be staged before
--continue. - Manual deletion of .git/rebase-* directories: prefer
--abort; only consider manual cleanup if the repository is already corrupted and you understand the risk. - CRLF vs LF differences: configure
core.autocrlfor.gitattributesto prevent noisy conflicts. - Binary or large-file conflicts: you must pick one side or re-create binaries; staging is still required.
Performance notes
- Rebase cost scales with number of commits and conflicts. Keep feature branches short-lived.
- Enable rerere to auto-apply previously recorded resolutions:
git config rerere.enabled true. - Use partial rebases to limit scope:
git rebase --onto <base> <upstream> <branch>. - For very large repos, run
git fetch --prune --tagsregularly and considergit gcduring maintenance windows to keep operations snappy.
Tiny FAQ
Q: Why do I see “fatal: You have not concluded your rebase”?
A: A prior rebase is unfinished. Resolve conflicts andgit rebase --continue, or--abort.Q: How do I know what I’m about to skip?
A: Inspect the current patch withgit show REBASE_HEAD(when available) or review the todo list withgit rebase --edit-todo.Q: I resolved conflicts but Git still complains.
A: Ensure all conflicted files are staged (git add <file>). Then rungit rebase --continue.Q: Can I switch branches during a rebase?
A: Not safely. Finish or abort the rebase first.Q: I aborted; can I get back to where I was?
A: Usegit reflogto find the previous HEAD andgit reset --hard <entry>if you need to restore it.