‘Pull is not possible because you have unmerged files’

Days ago, I got this message problem when I tried to do the ‘git pull…’ thing in ‘mallard-documentation’ branch

julita@yulys:~/GNOME/baobab/help/C$ git pull --rebase origin mallard-documentation
U help/C/scan-remote.page
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -

This happened when I was trying to do changes in baboab topics and the branch was rebased by Kat (when someone “rebases” a branch, it means that they “edit” it)… so what Kat did was merge many commits into few commits (for example, instead of 5 commits which edited the same file, we did have only one commit).

source ->

I will show the process I followed to solve the problem. I made it with Kat’s guidance, she is patience 🙂

julita@yulys:~/GNOME/baobab/help/C$ gitk --all

julita@yulys:~/GNOME/baobab/help/C$ git stash pop
help/C/scan-remote.page: needs merge
unable to refresh index
julita@yulys:~/GNOME/baobab/help/C$ git reset --hard origin/mallard-documentation
HEAD is now at ff2e1e2 Add more steps for optional information for scanning.
julita@yulys:~/GNOME/baobab/help/C$ gitk

About Julita Inca

Ingeniero de Sistemas UNAC, Magíster en Ciencias de la Computación PUCP, Magíster en Computación de Alto Rendimiento de la Universidad de Edimburgo, OPW GNOME 2011, Miembro de la GNOME Foundation desde el 2012, Embajadora Fedora Perú desde el 2012, ganadora del scholarship of the Linux Foundation 2012, experiencia como Admin Linux en GMD y Especialista IT en IBM, con certificaciones RHCE, RHCSA, AIX 6.1, AIX 7 Administrator e ITILv3. Experiencia académica en universidades como PUCP, USIL y UNI. Leader of LinuXatUNI Community, HPC Software Specialist at UKAEA, and reviewer of the Technological Magazine of ESPOL-RTE, and volunteering Linux training for MINSA Peru... a simple mortal, just like you!
This entry was posted in GNOME, GNU/Linux/Open Source and tagged , , , , , , , , . Bookmark the permalink.

8 Responses to ‘Pull is not possible because you have unmerged files’

  1. wololo says:


    Do you use `git mergetool` to fix unmerged files ?


  2. Stefan says:

    It seems there is at least a “git stash” missing (or is this done automagically by git pull?). Also the two screenshots are the same. And wouldn’t it be easier if you first stashed away your local changes, pulled the remote changes and only then restored your local changes with “git stash pop”?

  3. arpia49 says:

    Maybe I understood it wrong but… no one should rebase something made public.

  4. Ryan says:

    If she made too many small commits and pushed them into a public repo, that’s public history. You shouldn’t rebase public history. The whole point of keeping the history is to show the changes exactly as they happened for future reference. Rebasing is for a last resort when you accidentally check in your credit card number or something, not just to make your commits look smarter or prettier.

    • Alex says:

      Wrong! Rebasing is a good way to bring a *private* branch up to date before making it public. It keeps the history linear, unlike merging. Of course, it’s largely a matter of personal preference; I’ve seen arguments in favor of each one.

  5. arpia49 says:

    “the branch was rebased by Kat”.

    Others than Kat have access, so it’s a “public branch”.

  6. Cam Collins says:

    I had the exact same problem on a private GitHub repo. “git reset –hard origin” worked for me. Thanks!

  7. bhumishah says:

    you can solve error by just adding file using git add.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s