0

我通常将 --app 标志用于多个应用程序,但最近发现了 --remote。我更喜欢更通用的 --remote 但一直无法让它工作。

“git remote”列出了原始、暂存和生产,但运行,例如,“heroku logs --remote staging”会产生“未指定应用程序”错误。

在 Heroku irc 频道中有人告诉我,这应该可以工作,而且 --remote 可以用来代替 --app。我错过了什么?

heroku-toolbelt v. 2.37.2。谢谢。

4

1 回答 1

4

这可能是您的 git 遥控器未正确设置以匹配Toolbelt中的正则表达式的问题。要查看遥控器的详细信息,请运行:

git remote -v

这应该给你这样的东西:

dev     git@heroku.com:example-dev-ryan.git (push)
dev     git@heroku.com:example-dev-ryan.git (fetch)
origin  git@github.com:ryanbrainard/example.git (fetch)
origin  git@github.com:ryanbrainard/example.git (push)
prod    git@heroku.com:example.git (push)
prod    git@heroku.com:example.git (fetch)
staging git@heroku.com:example-staging.git (fetch)
staging git@heroku.com:example-staging.git (push)

确保您的 Heroku git 遥控器与模式匹配:

^git@#{Heroku::Auth.git_host}(?:[\.\w]*):([\w\d-]+)\.git$

Where#{Heroku::Auth.git_host}等于heroku.com,除非你在你的~/.ssh/config.

然后你就可以使用--remote(或-r简称),像这样:

heroku info --remote prod
于 2013-04-17T03:57:23.383 回答