Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

I keep getting this error when I do a git pull every 60 seconds on my monitoring server. I am using chef and a python script to "git pull" every 60 seconds.

Updating 70fe6e8..2da34fc
error: The following untracked working tree files would be overwritten by merge:
    rtb_redis_connections/redis_connections.pyc
Please move or remove them before you can merge.
Aborting

How do I deal with this? these pyc files keep getting created.

like image 688
Tampa Avatar asked Jul 24 '12 19:07

Tampa


2 Answers

My guess is that someone else has accidentally committed this file. How to resolve this:

Remove your local .pyc file

rm rtb_redis_connections/redis_connections.pyc

Do the pull

git pull

Remove the file from git and push up the changes

git rm rtb_redis_connections/redis_connections.pyc
git commit -m "Remove pyc file"
git push origin master

Assuming that you are working on the master branch that is.

like image 116
ralphtheninja Avatar answered Sep 22 '22 05:09

ralphtheninja


Please move or remove them before you can merge.

Aborting

The solution is actually very simple:

git clean  -d  -fx ""
  • X - delete ignore file has not identified for git files
  • D -- deletion was not added to the git in the path of the file
  • F - forced operation
like image 20
Srikanth Lanka Avatar answered Sep 25 '22 05:09

Srikanth Lanka