【发布时间】:2013-04-24 11:33:51
【问题描述】:
我在 heroku 上设置了我的登台和生产环境,并推送到两者,它运行良好。一天后我回来并能够推送到 staging 但收到以下关于 git push production master 的消息:
fatal: 'production' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
【问题讨论】:
-
检查您的
history并确保这实际上是您之前使用的命令。该错误表明您不在正确的文件夹中,或者以这种方式使用production导致 git 认为您将production称为存储库或 git 远程分支,其中没有任何这样的名称存在。换句话说,您可能有一个简单的错字,应该相对容易发现。 -
尝试运行
git remote -v,它将列出您所有的远程别名及其各自的URL。 -
@normalocity 谢谢,但我很确定这是确切的命令,我把它写下来供我参考;我在历史上找不到它。我在哪里可以找到它的名字?有没有我可以运行的命令来找出答案?或者我可以在 heroku 的 web gui 中找到某个地方?
-
@mmichael 嗨,谢谢,我试过了,但我没有看到生产环境!我只看到 staging、github 和 git - 我认为这与 staging 相同?或者不是?和生产设置为
heroku和分期是分开的?我以为默认是在上演,现在看来不是这样? -
查看存储库本地副本中的
.git/config文件 - 是否有名为production的远程引用?对 heroku 的标准推送是:git push heroku [branch name],所以如果你用production替换heroku,那么.git/config文件中应该有一个等效的条目。
标签: ruby-on-rails ruby-on-rails-3 git heroku production-environment