How to fix fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge. in Git

GitBEGINNERLOWUpdated Dec 6, 2025ยท 379 views

This error occurs when Git detects an incomplete merge operation in your repository. A previous merge was started but never finished - either due to unresolved conflicts or a forgotten commit. Fix by completing the merge with a commit, aborting the merge, or manually removing the MERGE_HEAD file.

Quick fix

Fixes fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge.

git status
  1. Check current repository status
  2. Option 1: Complete the merge (recommended)
  3. Option 2: Abort the merge
  4. Option 3: Hard reset (if nothing else works)
git โ€” error
git status
fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge.

What this error means

When you run a merge command in Git, it creates a special file called `.git/MERGE_HEAD` that tracks the commit being merged into your current branch. This file signals to Git that a merge operation is in progress. The "MERGE_HEAD exists" error occurs when Git detects this file while you're trying to perform another operation (like checkout, pull, or another merge). Git is telling you: "Hey, you started a merge but never finished it. Please complete that first." This typically happens in one of these scenarios: 1. **Merge conflicts occurred**: You started a merge, conflicts were detected, and you resolved them but forgot to run `git commit` to finalize the merge. 2. **Merge was interrupted**: You started a merge and then got distracted, closed your terminal, or switched to another task without completing it. 3. **Partial conflict resolution**: You resolved some conflicts and staged the files with `git add`, but never committed the merge result. Until you either complete the merge (by committing) or abort it, Git will block most operations to prevent you from creating an inconsistent repository state.

Typical symptoms

  • Git commands fail with 'fatal: You have not concluded your merge (MERGE_HEAD exists)'
  • Cannot checkout another branch while merge is pending
  • Cannot pull or fetch without completing or aborting the merge
  • Running another git merge shows this error
  • Git status shows 'All conflicts fixed but you are still merging'
  • File .git/MERGE_HEAD exists in your repository

Common causes

  1. Merge conflicts were resolved but changes were never committed (most common)
  2. Merge operation was interrupted before completion
  3. User ran git add after resolving conflicts but forgot to run git commit
  4. Terminal or IDE was closed during an active merge
  5. Attempted another Git operation before finishing the current merge
  6. Git GUI tool failed to complete the merge properly

How to fix "fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge."

1Check current repository status

First, understand the current state of your repository:

bash
git status

This will show you one of several possible states:

If all conflicts are resolved:

bash
On branch main
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

If conflicts still exist:

bash
On branch main
You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

Unmerged paths:
  both modified:   filename.txt

This status tells you exactly what needs to be done next.

2Option 1: Complete the merge (recommended)

If you want to keep the merge changes, complete it by committing:

If all conflicts are already resolved:

bash
git commit -m "Merge branch 'feature-branch' into main"

Git may open your default editor for a merge commit message. Save and close to complete.

If conflicts still need resolution:

1. Open each conflicting file and resolve the conflicts (look for <<<<<<<, =======, and >>>>>>> markers)

2. After resolving each file, stage it:

bash
git add <resolved-file>

3. Once all conflicts are resolved, commit:

bash
git commit -m "Merge branch 'feature-branch' into main"

Using git merge --continue:

If you've already resolved all conflicts and staged the files, you can also use:

bash
git merge --continue

This is equivalent to running git commit and will finalize the merge.

3Option 2: Abort the merge

If you want to cancel the merge and return to the state before it started:

bash
git merge --abort

This command will:
- Remove the MERGE_HEAD file
- Reset your working directory to the state before the merge
- Discard any conflict resolutions you made

If git merge --abort fails:

Sometimes you may see: "Entry 'filename' not uptodate. Cannot merge."

In this case, first stage your changes:

bash
git add .
git merge --abort

Alternative - git reset:

For older Git versions (before 1.7.4), use:

bash
git reset --merge

This achieves the same result as git merge --abort.

4Option 3: Hard reset (if nothing else works)

If the above methods don't work, you can perform a hard reset:

Warning: This will discard ALL uncommitted changes in your working directory.

bash
git reset --hard HEAD

This resets your branch to the last commit, removing the merge state and any uncommitted changes.

If you need to reset to a specific commit:

bash
# View recent commits
git log --oneline -5

# Reset to a specific commit
git reset --hard <commit-hash>

Last resort - manually remove MERGE_HEAD:

If Git commands are still not working, you can manually delete the merge state files:

bash
rm -f .git/MERGE_HEAD
rm -f .git/MERGE_MSG
rm -f .git/MERGE_MODE

After this, run git status to verify the merge state is cleared. Note that this may leave your working directory in an inconsistent state, so review your files carefully.

5Verify the fix

After completing or aborting the merge, verify everything is working:

bash
# Check status - should show clean working tree
git status

# Verify MERGE_HEAD is gone
ls .git/MERGE_HEAD 2>/dev/null || echo "MERGE_HEAD cleared"

# Test that other operations work
git log --oneline -3

You should now be able to:
- Checkout other branches
- Pull from remote
- Start new merges
- Perform other Git operations normally

Advanced notes

### Understanding Git's Merge State Files

When a merge is in progress, Git creates several files in the .git directory:

| File | Purpose |
|------|---------|
| MERGE_HEAD | Contains the SHA of the commit being merged |
| MERGE_MSG | Pre-populated merge commit message |
| MERGE_MODE | Contains merge mode flags (if any) |

These files together tell Git that a merge is in progress. They are automatically removed when the merge completes or is aborted.

### Merge vs Rebase State

A similar error can occur during a rebase operation. If you see REBASE_HEAD instead of MERGE_HEAD, use:

bash
git rebase --abort
# or
git rebase --continue

### Recovering Lost Work

If you accidentally aborted a merge and lost conflict resolutions:

bash
# Check reflog for recent HEAD positions
git reflog

# You may be able to recover to a previous state
git reset --hard HEAD@{1}

### Git GUI Tools

If you use a GUI tool like VS Code, GitKraken, or Sourcetree:

1. The tool should show a "merge in progress" indicator
2. Use the tool's "Commit" or "Complete Merge" button
3. Or use the "Abort Merge" option in the menu

### Preventing This Error

To avoid this situation in the future:

1. Always check `git status` after resolving conflicts
2. Don't walk away from an active merge without completing it
3. Use `git stash` if you need to switch tasks mid-merge
4. Set up merge conflict markers in your editor for easy identification

### Handling Repeated Merge Conflicts

If you frequently encounter the same conflicts when merging:

bash
# Enable rerere (Reuse Recorded Resolution)
git config --global rerere.enabled true

This makes Git remember how you resolved conflicts and automatically apply the same resolution in the future.

Frequently asked questions

What does "fatal: You have not concluded your merge (MERGE_HEAD exists). Please," mean?
git/MERGE_HEAD that tracks the commit being merged into your current branch. This file signals to Git that a merge operation is in progress. The "MERGE_HEAD exists" error occurs when Git detects this file while you're trying to perform another operation (like checkout, pull, or another merge).
How do I fix "fatal: You have not concluded your merge (MERGE_HEAD exists). Please,"?
This error occurs when Git detects an incomplete merge operation in your repository. A previous merge was started but never finished - either due to unresolved conflicts or a forgotten commit. Fix by completing the merge with a commit, aborting the merge, or manually removing the MERGE_HEAD file.
What causes "fatal: You have not concluded your merge (MERGE_HEAD exists). Please,"?
Merge conflicts were resolved but changes were never committed (most common) Merge operation was interrupted before completion User ran git add after resolving conflicts but forgot to run git commit
Is the "fatal: You have not concluded your merge (MERGE_HEAD exists). Please," error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading