Pulling is not possible because you have unmerged files

Tested on RHEL 10.2 (Coughlan)
Package git 2.52.0
Applies to Any host with Git installed
Privilege Normal user
Scope Fix the exact pull blocked by unmerged files error: read git status, resolve markers, and finish or abort merge, rebase, or cherry-pick. Worked examples state a starting situation and commands — not a from-scratch lab.
Related guides Git merge examples
Git rebase tutorial
Git stash explained
Git reflog tutorial
Git pull command examples

Git shows Pulling is not possible because you have unmerged files when you run git pull while an earlier operation left conflicted files unresolved. Run git status first — it tells you which operation is stuck and what to run next.

The sections below are independent scenarios. Pick the one that matches your git status output — they are not steps in one lab sequence.


Check Which Git Operation Is In Progress

When to use this: you just saw the pull error or suspect an unfinished conflict.

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

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   app.conf

no changes added to commit (use "git add" and/or "git commit -a")

Read the status message and the Unmerged paths list. After you edit each conflicted file and run git add on it, finish or cancel the operation that git status names:

Operation Finish after resolving Cancel
Merge git commit or git merge --continue git merge --abort
Rebase git rebase --continue git rebase --abort
Cherry-pick git cherry-pick --continue git cherry-pick --abort

The sections below walk through merge resolution in detail. Use the row that matches your git status output — do not guess from the pull error alone.


What "Pulling Is Not Possible Because You Have Unmerged Files" Means

git pull first fetches remote changes and then integrates them into your current branch, normally by merging or rebasing depending on your configuration. A simple update may fast-forward without creating a merge commit.

Git cannot start that new integration while the index still contains unresolved files from an earlier operation. If a previous pull, merge, rebase, or cherry-pick stopped on a conflict and you never finished it, files stay unmerged and another git pull is blocked.

If you retry pull before clearing that state:

bash
git pull
output
error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

Resolve the open conflict and complete the operation, or abort it.


Resolve the Unmerged Files and Finish the Merge

Scenario: merge in progress — you are on main, you ran git merge feature, and Git stopped on app.conf because both branches changed the same lines. You have not committed the merge yet.

Side Change in app.conf
Current branch (main) Added main=true
Branch being merged (feature) Added feature=true

The same edit → git add → verify → commit flow applies when a merge-based git pull stops on conflicts — only the branch names in the markers differ.

Step 1: Read the conflict markers

Open the unmerged file:

bash
cat app.conf
output
version=1
<<<<<<< HEAD
main=true
=======
feature=true
>>>>>>> feature

Lines above <<<<<<< HEAD are unchanged. In a merge, the marker blocks work like this:

Part of the file Plain name In this example
Top block — <<<<<<< HEAD to ======= Your current branch main=true from main
Bottom block — ======= to >>>>>>> Incoming branch feature=true from feature

The top block is the content from your current branch (main), while the bottom block is the conflicting content Git is trying to merge from feature. Git does not pick a winner automatically — you choose what stays when you edit the file.

Step 2: Resolve the file

Remove every marker line and keep the content you need:

What you need Keep
Current branch is correct Top block only — main=true
Incoming branch is correct Bottom block only — feature=true
Both are valid Both lines

This example keeps both lines:

text
version=1
main=true
feature=true

Step 3: Stage the resolved file

Tell Git the conflict in app.conf is resolved:

bash
git add app.conf

Confirm the file is no longer listed under Unmerged paths:

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

Changes to be committed:
	modified:   app.conf

app.conf is no longer under Unmerged paths. The conflict is resolved, but the merge itself is not finished until you commit.

Step 4: Complete the merge

When every former unmerged path is staged:

bash
git commit -m "Merge branch 'feature'"
output
[main 8c8e2f1] Merge branch 'feature'

git status should report a clean working tree. You can run git pull again if you still need remote updates.


If the Operation Is a Rebase or Cherry-Pick

Scenario: git status mentions rebase or cherry-pick in progress, not a plain merge.

Edit each conflicted file, remove the markers, and run git add on each resolved path. Finish with the matching --continue command below.

Continue a Rebase

During a rebase, HEAD in the top conflict block represents the new base plus commits already replayed, while the other block is the commit Git is currently replaying. Resolve the content you want to keep, remove the markers, stage the file, then run git rebase --continue.

After every conflicted file is edited and staged:

bash
git rebase --continue

Continue a Cherry-Pick

After every conflicted file is edited and staged:

bash
git cherry-pick --continue

Abort Instead of Resolving

Scenario: the conflict is too messy, or you want to return to how the branch looked before the operation started.

Operation Cancel command
Merge git merge --abort
Rebase git rebase --abort
Cherry-pick git cherry-pick --abort

After a successful abort, the unmerged state is cleared. You can try git pull again, although Git may still stop for another reason such as unrelated local changes.

git merge --abort may not perfectly reconstruct pre-merge work when substantial uncommitted changes existed before the merge began. Use abort when you prefer to discard the in-progress operation and restart from a clean branch tip.


Why Git Stash Does Not Fix Unmerged Files

Scenario: you tried git stash to clear the error so you can pull, but the unmerged state remains.

git stash saves ordinary uncommitted changes, but an unresolved conflict is different: Git's index contains multiple unmerged versions of the file. Stash normally cannot clear that state.

If git status lists Unmerged paths, edit and stage those files, complete the operation with commit or continue, or abort it. Stash helps a different pull problem — local modifications that would be overwritten — not unmerged files from an unfinished merge, rebase, or cherry-pick.


Troubleshooting

Problem What to do
error: you need to resolve your current index first when switching branches The same unresolved conflict is blocking checkout; run git status, then resolve and continue or abort the current operation
cherry-pick is currently in progress Resolve files, git add, then git cherry-pick --continue; or git cherry-pick --abort
Not sure merge vs rebase vs cherry-pick Read the action line in git status — it names commit, continue, or abort
Used stash but error remains Stash does not clear unmerged index state; finish resolution or abort
Want to cancel and retry later Run the matching --abort command. After the conflict state is cleared, retry the operation you actually need.

References

Git documentation: git-merge
Git documentation: git-pull
Git documentation: git-status
Git documentation: git-rebase
Git documentation: git-cherry-pick


Summary

When pull fails with unmerged files, run git status immediately. The decision table at the top names the finish or cancel command for merge, rebase, or cherry-pick.

For a merge stop, edit conflict markers, git add each resolved file, confirm Unmerged paths is gone, then commit. The same marker workflow applies when a merge-based git pull conflicts. For rebase or cherry-pick, stage fixes and run the matching --continue command, or --abort to cancel.

git stash does not clear unmerged conflict state. After you commit or abort, git pull can run again — though other local changes may still block it.


Frequently Asked Questions

1. Why does Git say pulling is not possible because you have unmerged files?

An earlier merge, pull integration, rebase, or cherry-pick stopped on a conflict and you have not finished it yet. Git blocks git pull until every unmerged file is resolved and the in-progress operation completes or is aborted.

2. How do I fix unmerged files in Git?

Run git status to list unmerged paths, edit each file to remove conflict markers, run git add on each resolved file, then git commit for a merge, git rebase --continue for a rebase, or git cherry-pick --continue for a cherry-pick.

3. Can I git pull after resolving unmerged files?

Yes, after you finish the in-progress operation with commit or continue, or abort it. Then run git pull again if you still need remote updates.

4. Should I use git stash for unmerged files?

No. git stash saves ordinary uncommitted changes, but unmerged conflict state lives in the index and stash normally cannot clear it. Resolve and stage the files, or abort the in-progress operation.
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, networking, and security, delivering robust and efficient solutions for diverse projects.

  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security
  • Cloud Computing
  • Kubernetes
  • Linux
  • Ansible (software)