Bootstrap FreeKB - Git (Version Control) - Resolve "Pull is not possible because you have unmerged files"
Git (Version Control) - Resolve "Pull is not possible because you have unmerged files"

Updated:   |  Git (Version Control) articles

Let's say the following error is returned after issuing the git pull command.

~]# git pull
U       example.txt
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'.

 

The git diff command can be used to show the are differences between the file in the currently selected branch of the cloned repository and the origin Git repository. In this example, the output shows that "Hello World" was added to example.txt in the currently selected branch of the cloned repository.

~]# git diff example.txt
diff --git a/example.txt b/example.txt
index bcd9498..8932028 100755
--- a/example.txt
+++ b/example.txt
+ Hello World

 

In this example, you would edit example.txt in the currently selected branch of the cloned repository and resolve the merge conflicts. Then, use the git commit command to commit the change to the file.

git commit -m "your commit message" example.txt

 

And then reissue the git pull command, and ideally, you should be prompted to merge.

~]# git pull
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 14 (delta 12), reused 0 (delta 0)
Unpacking objects: 100% (14/14), done.
From ssh://git@example.com:7999/path/to/example
   f8d0aef..de799b6  master     -> origin/master
Merge made by the 'recursive' strategy.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter fffdcf in the box below so that we can be sure you are a human.