Back to Top

Solution: Git Pull is not possible because you have unmerged files

Solution: Git Pull is not possible because you have unmerged files

Git is a distributed version control system with C language development. Version control system can keep a history of files, and can roll back files to another state using history.

Git and Github include some very cool features. Here I am going to share solution of one of the issues you ever get if you have used GitHub.

It is very common issue you might get while using Github and issue is listed below:

Pull is not possible because you have unmerged files.
Please, fix them up in the working tree, and then use 'git add/rm '
as appropriate to mark resolution or use 'git commit -a'.

This issue might occur if you have changes in same files or same line of the file.So GitHub is not allowing to pull changed before you merge its index.

Firstly, I don’t understand what is this issue so I searched this issue in google and every site where I get solution and everyone is saying to commit files or remove uncommitted files to pull files from server.
But it is not possible because I want to keep changes and also want to get changes from the server.

Git has three working areas, namely: the working directory (Working Directory), the staging area (Stage or Index) and repository (Repository or Git Directory).

So as the solution of the above issue what I did is, Add the file to Github using git add command because I don’t want to commit local changes to pull changes from server and technically it is not necessary too.
Let’s check the command:

 git add filename
 git stash
 git pull
 git stash pop

The git adds command adds a change in the working directory to the staging area, then, change the status Staged was placed Git staging area.Git adds command will inform Git that you have changes in the same file and will include updates to a particular file in the next commit.

Git add command not affect the repository in any way,It just add file contents to the index so changes in the files are not recorded until you run git commit command so it is the safest way or solution you can do when you get above error.

Here, I am done with my article and hope this solution is useful to you and clear your mind, let me know if you have any suggestion/comments/questions on this trick/article.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How To Change Database PREFIX in WordPress

Posted on 7 years ago


Objects and Classes in PHP

Posted on 2 years ago


Hello world

Updated 1 month ago

Nick Carter

In depth Understanding of Laravel Core

Updated 3 months ago


ECMAScript 6 New Features – 2

Updated 1 year ago


The Reader’s Poll – June 2015

Posted on 4 years ago


The Reader’s Poll – August 2014

Posted on 5 years ago


The Reader’s Poll – June 2014

Posted on 5 years ago


The Readers’ Poll – May 2014

Posted on 5 years ago


The Readers’ Poll – August 2013

Posted on 6 years ago