1

在我的 ec2 实例上,我正在尝试对我的 github 存储库进行拉取请求。我收到以下错误。在我的本地机器上,我提交了所有内容。如果这是问题,我该如何处理 pyc 文件?

git add .
git commit -m 't'
git push origin development

git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 2 (delta 1), reused 2 (delta 1)
Unpacking objects: 100% (2/2), done.
From https://github.com/me/rtbopsConfig
   8e320f6..0565407  development -> origin/development
Updating 94f7f3e..0565407
error: Your local changes to the following files would be overwritten by merge:
    classes/ec2/ec2Auto.pyc
    classes/redis_ha.pyc
    classes/rtbUtilities.pyc
    rtb_redis_connections/redis_connections.pyc
Please, commit your changes or stash them before you can merge.
Aborting
4

1 回答 1

7

你不应该.pyc在 Git 中存储文件。在您的工作站上,执行

find . -name *.pyc -exec git rm {} \;

然后在 中添加一行*.pyc.gitignore提交所有更改并推送。

在另一端 (EC2),执行

git checkout classes/ec2/ec2Auto.pyc classes/redis_ha.pyc \
             classes/rtbUtilities.pyc rtb_redis_connections/redis_connections.pyc

然后拉。

于 2012-06-20T12:10:17.067 回答