How to fix fatal: It seems that there is already a rebase-apply directory in Git

GitBEGINNERMEDIUMUpdated Dec 6, 2025· 238 views

This error occurs when Git detects an incomplete rebase or git am operation. The .git/rebase-apply directory tracks rebase state, and Git prevents new rebases when one is already in progress.

Quick fix

Fixes fatal: It seems that there is already a rebase-apply directory

git status
  1. Check your current Git status
  2. Continue the rebase if conflicts are resolved
  3. Abort the rebase to return to your original state
  4. Skip the problematic commit
git — error
git status
fatal: It seems that there is already a rebase-apply directory

What this error means

When you see this error, Git is telling you that a previous rebase or `git am` (apply mailbox) operation was started but never completed. Git stores rebase state in a hidden directory called `.git/rebase-apply` to track which commits have been applied and which are pending. This typically happens when a rebase encounters a merge conflict and you forget to resolve it, when you switch branches or close your terminal mid-rebase, or when a system crash interrupts the process. Git refuses to start a new rebase because doing so would overwrite the existing state and potentially lose your work. The error is a safety mechanism—Git wants you to deliberately decide what to do with the incomplete rebase before starting another one.

Typical symptoms

  • Running git rebase fails immediately with the rebase-apply directory error
  • git pull --rebase fails with the same error
  • You cannot start a new rebase on any branch
  • git status may show "rebase in progress" or list no staged changes
  • The .git/rebase-apply directory exists in your repository

Common causes

  1. A previous rebase was interrupted by merge conflicts and never completed
  2. You closed the terminal or switched branches during an active rebase
  3. A system crash or power loss occurred mid-rebase
  4. git am was used to apply patches and encountered errors
  5. IDE or GUI tools crashed while performing a rebase operation

How to fix "fatal: It seems that there is already a rebase-apply directory"

1Check your current Git status

First, understand what state Git is in by running:

bash
git status

This will tell you if a rebase is in progress, if there are conflicts to resolve, and what branch you're on. Look for messages like "rebase in progress" or "You are currently rebasing".

2Continue the rebase if conflicts are resolved

If you have previously resolved the merge conflicts or want to continue where you left off:

bash
git rebase --continue

If there are still unresolved conflicts, Git will tell you which files need attention. Open each conflicted file, resolve the markers (<<<<<<<, =======, >>>>>>>), then stage the resolved files with git add <filename> before running --continue again.

3Abort the rebase to return to your original state

If you don't want to continue the rebase and prefer to start fresh:

bash
git rebase --abort

This will cleanly undo the rebase operation, restore your branch to its state before the rebase started, and remove the .git/rebase-apply directory.

4Skip the problematic commit

If the current commit is causing issues and you want to skip it entirely:

bash
git rebase --skip

Use this with caution—the skipped commit's changes will not be included in your rebased branch. This is useful when the commit is already applied or creates an empty patch.

5Handle git am in progress errors

If you see "It looks like git am is in progress" when trying to abort:

bash
git am --abort

The git am command is used to apply patches from mailbox files, and it uses the same .git/rebase-apply directory. Abort it first, then you can proceed with your intended operation.

6Manually remove the rebase-apply directory (last resort)

If none of the above commands work and you're certain you want to abandon the rebase:

bash
rm -rf .git/rebase-apply

Warning: Only do this if the standard abort commands fail. This forcefully removes the rebase state without any cleanup. After running this, verify your repository is in a good state with git status and git log.

Advanced notes

### Understanding the .git/rebase-apply directory

The .git/rebase-apply directory contains several files that track rebase state:
- head-name: The branch being rebased
- onto: The commit you're rebasing onto
- patch: The current patch being applied
- msg: The commit message for the current patch

### Difference between rebase-apply and rebase-merge

Git uses different directories depending on the rebase strategy:
- .git/rebase-apply: Used by git rebase (default am-based) and git am
- .git/rebase-merge: Used by git rebase -m (merge-based) or git rebase -i (interactive)

If you see an error about rebase-merge instead, the same resolution steps apply but substitute the directory name.

### Preventing this in CI/CD pipelines

In automated environments, always ensure previous rebase state is cleaned up:

bash
git rebase --abort 2>/dev/null || true
git am --abort 2>/dev/null || true

### Windows-specific considerations

On Windows, the rebase-apply directory may persist due to file locking. Ensure no Git GUI tools or editors have the repository open, then try the removal command in a new terminal window.

Frequently asked questions

What does "fatal: It seems that there is already a rebase-apply directory" mean?
When you see this error, Git is telling you that a previous rebase or git am (apply mailbox) operation was started but never completed. git/rebase-apply to track which commits have been applied and which are pending. This typically happens when a rebase encounters a merge conflict and you forget to resolve it, when you switch branches or close your terminal mid-rebase, or when a system crash interrupts the process.
How do I fix "fatal: It seems that there is already a rebase-apply directory"?
This error occurs when Git detects an incomplete rebase or git am operation. The .git/rebase-apply directory tracks rebase state, and Git prevents new rebases when one is already in progress.
What causes "fatal: It seems that there is already a rebase-apply directory"?
A previous rebase was interrupted by merge conflicts and never completed You closed the terminal or switched branches during an active rebase A system crash or power loss occurred mid-rebase
Is the "fatal: It seems that there is already a rebase-apply directory" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading