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

标签 git github

当我在监控服务器上每 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/

相关文章:

macos - 什么是 Boxen,它有什么作用?

git - Git 是否需要集中式服务器?

git - 如何为 bash 脚本编写基于 Web 的 GUI?

c++ - 在 diffs 上设置 C/C++ 文件的样式

GIT:如何撤消 merge ?

身份验证无法从Windows的Github发布存储库

Git 从 TeamCity 9.0.3 构建推送

git - 只对某些 git url/域使用代理?

当前分支版本的 GitHub 比较 View

Python - 不依赖于 git 二进制文件的 Git 模块