Latest Post

Error: No input file specified.

While trying to run a codeigniter app the other day I came across this error just after I had finished uploading the files and making the ne...

Tuesday, May 26, 2015

error: The following untracked working tree files would be overwritten by merge

I'm using Git for version control and because the repository is sometimes directly modified for urgent fix to test some theory in the staging server (not the best way for doing things), I’ll occasionally get an error similar to the one below one when doing a git pull:

error: The following untracked working tree files would be overwritten by merge
 [list of file(s) here]
Please move or remove them before you can merge.
Aborting
In my case, I will want to overwrite these files. So I use the following:
git fetch --all
git reset --hard origin/master

This will get the latest repository files without merging and resets the master branch and overwrites the modified ones.

Chitika Ads