【问题标题】:how to find status of my code with regard to my app's git repo on heroku如何在 heroku 上查找我的应用程序的 git repo 的代码状态
【发布时间】:2013-02-07 06:24:26
【问题描述】:

我在 heroku 上创建了一个应用程序并推送了我的代码(在 git init 创建 git repo 之后)。
我的app 文件夹包含一个requirements.txt,我错误地将matplotlib 放在numpy 之前。 (实际上需要numpy 来安装matpplotlib,所以应该在它之前)。

当我推送到 heroku master,时,编译失败并显示错误消息“需要 numpy 来安装 matplotlib”。
所以我更正了requirements.txt 中的项目顺序,并使用git addgit commit 等提交了它。
然后我尝试使用git push heroku master 再次推送代码。
但它失败并显示相同的错误消息

这里是requirements.txt

Django==1.4.3
South==0.7.6
distribute==0.6.28
dj-database-url==0.2.1
django-registration==0.8
numpy==1.6.2
matplotlib==1.2.0
psycopg2==2.4.6
python-memcached==1.48
wsgiref==0.1.2
simplejson==3.0.7

然后我尝试使用

查找状态

git status 它产生了

# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
# nothing to commit (working directory clean)

我曾经将我的代码添加到 Github。
我认为origin/master 与此有关。我错了吗?

如何在 heroku 上找到我的提交状态?
我的应用有一个名称为git@heroku.com:myapp.git

【问题讨论】:

    标签: git heroku status


    【解决方案1】:

    关于状态,您有多种选择:

    git 远程 -v 更新 git 状态 -uno git 获取 heroku git log --name-only ..heroku/master

    检查origin 是否指向heroku

    git remote -v
    

    在这种情况下,一个简单的git push 是不够的

    根据您的默认推送策略,您可能需要确保您的分支将 heroku/master 作为上游分支:

    git push -u heroku master
    

    【讨论】:

    • 我在做git push heroku master
    • @damon 然后我会尝试简化并推送一个没有numpy 的requirements.txt 需要安装matpplotlib,然后一个只需要numpy,然后一个需要两者。如果第一次推送失败,那么这完全是另一个问题。
    • @damon 我已经编辑了答案以解决您问题的状态点。
    • 感谢有关状态的输入..正如您所建议的,我推送了一个只有 numpy 的 req 文件并编译了..然后我推送了没有 numpy 的 req 文件,但添加了 matplotlib,并且一切都正确安装..当 numpy 和 matplotlib 都在 req 文件中时会出错..
    • @damon 很奇怪,那似乎是 heroku 的怪事。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-16
    • 1970-01-01
    • 2013-02-09
    • 2013-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多