‘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

Advertisement

About Julita Inca

System Engineering degree at UNAC, Computer Science Masters at PUCP, High Performance Masters at University of Edinburgh, Winner OPW GNOME 2011, GNOME Foundation member since 2012, Fedora Ambassador since 2012, winner of the Linux Foundation scholarship 2012, Linux Admin at GMD 2012, IT Specialist at IBM 2013. Academia experience in lecturing at PUCP, USIL and UNI Peru (2010-2018). HPC intern at ORNL 2018. HPC Software Specialist at UKAEA since 2020. Tech Certifications: RHCE, RHCSA, AIX 6.1, AIX 7 Administrator, and ITILv3. Leader of LinuXatUNI Community, Creator of the "Mujeres Imperfectas | I'm perfect woman" channel, Reviewer of the Technological Magazine of ESPOL-RTE, Online trainer at BackTrackAcademy, blogger, photographer, IT-Linux-HPC-science worldwide speaker, graphic designer, researcher, content creator, press communicator... a simple mortal, just like you!
This entry was posted in GNOME, GNU/Linux/Open Source and tagged , , , , , , , , . Bookmark the permalink.

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

  1. wololo says:

    Hi,

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

    Regards,

  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.

  8. Pingback: Git stash pop- needs merge, unable to refresh index - ErrorsFixing

  9. Pingback: Git stash pop- needs merge, unable to refresh index - PhotoLens

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 )

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