Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pull is not possible because you have unmerged files

Tags:

git

When I am trying to pull from git,getting below error

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 -a'.

I have tried to stash changes but after stash pull is not working, asking for merge.

How can I pull changes without commiting/adding existing?

like image 887
Bhumi Shah Avatar asked Apr 30 '15 12:04

Bhumi Shah


People also ask

How do you fix pulling is not possible because you have unmerged files?

To fix the “pulling is not possible” error, you can use git reset –hard. Always write a commit message after adding a file to Git's history. Ensure your files are updated to avoid conflict when pulling changes. You need to commit your changes or stash them before you can merge.

Why does git say pull is not possible because you have unmerged files?

So now, when you do a git pull , git is throwing up the error, because you have some version of the file, which is not correctly resolved. To resolve this, you will have to resolve the merge conflicts in question, and add and commit the changes, before you can do a git pull .

Is it possible to unmerged files git?

Git Pull is Not Possible, Unmerged Files.


1 Answers

First backup the conflicted files!


Then execute:

git fetch origin
git reset --hard origin/master (or your branch name)

This way you should get the full git repository code if you want restore conflict file or compare them.

like image 179
D.Y. Avatar answered Oct 07 '22 23:10

D.Y.