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).
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
Hi,
Do you use `git mergetool` to fix unmerged files ?
Regards,
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”?
Maybe I understood it wrong but… no one should rebase something made public.
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.
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.
“the branch was rebased by Kat”.
Others than Kat have access, so it’s a “public branch”.
I had the exact same problem on a private GitHub repo. “git reset –hard origin” worked for me. Thanks!
you can solve error by just adding file using git add.
Pingback: Git stash pop- needs merge, unable to refresh index - ErrorsFixing
Pingback: Git stash pop- needs merge, unable to refresh index - PhotoLens