Git pull - Please move or remove them before you can merge

Brett picture Brett · Mar 16, 2016 · Viewed 135.7k times · Source

I am trying to do a git pull origin master from my server but keep getting the error:

Please move or remove them before you can merge.

There are no untracked files, but it seems like it has issues with the ignored files for some reason.

I tried running a git clean -nd to see what would be deleted and it lists a whole bunch of files that are ignored in .gitignore.

How can I fix this so I can do a pull?

Answer

Neha picture Neha · Oct 30, 2017

I just faced the same issue and solved it using the following.First clear tracked files by using :

git clean -d -f

then try git pull origin master

You can view other git clean options by typing git clean -help