当我在监控服务器上每 60 秒执行一次 git pull 时,我不断收到此错误。我正在使用 chef 和 python 脚本每 60 秒“git pull”一次。
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
我该如何处理?这些 pyc 文件不断被创建。
最佳答案
我的猜测是其他人不小心提交了这个文件。如何解决这个问题:
删除本地 .pyc 文件
rm rtb_redis_connections/redis_connections.pyc
pull
git pull
从git中删除文件并推送更改
git rm rtb_redis_connections/redis_connections.pyc
git commit -m "Remove pyc file"
git push origin master
假设您正在处理 master 分支。
关于Git pull - 错误 : The following untracked working tree files would be overwritten by merge:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11637686/