我正在尝试 fork 我现有的应用程序,以便我可以创建一个与生产环境分开的暂存环境,但无论我尝试什么,我都会遇到错误。
我肯定有一个 heroku 工具带,而且我肯定已经登录了。
当我运行 git remote -v
我明白了:
origin https://github.com/account/mysite.git (fetch)
origin https://github.com/account/mysite.git (push)
production git@heroku.com:mysite.git (fetch)
production git@heroku.com:mysite.git (push)
当我运行 heroku fork -a production staging
我明白了:
Failed to fork app production to staging.
! WARNING: Potentially Destructive Action
! This command will destroy staging (including all add-ons).
! To proceed, type "staging" or re-run this command with --confirm staging
如果我输入 staging
然后我明白了:
Deleting staging... failed
! You do not have access to the app staging.
我感到困惑的是,为什么它认为存在一个名为“staging”的应用程序,我正在尝试将其作为一个新环境进行 fork 。
当我在终端中尝试其他建议时,我得到了这个:
heroku fork -a production --confirm staging
! Mismatch between --app and --confirm
Failed to fork app to .
! Confirmed app staging did not match the selected app .
当我尝试 heroku apps:info
我得到:
! App not found
这看起来也很奇怪。如果我指定 heroku apps:info --app staging
或 heroku apps:info --app production
然后我得到
! You do not have access to the app staging.
当我尝试 git remote rm staging
它只是确认没有“暂存”环境:
error: Could not remove config section 'remote.staging'
我似乎也没有工作的“生产”方面,就像我做的那样git push production master
我明白了
! No such app as mysite.
但是当我访问http://mysite.herokuapp.com它绝对存在!
这让我发疯 - 谁能帮忙?
最佳答案
staging
应该是您正在创建的应用程序的名称,而不是 git remote 的名称。您需要选择一个唯一的名称。我通常使用 mysite-prod
和 mysite-staging
作为我的应用程序名称。
关于git - 为多个环境 fork 我现有的 heroku 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22313648/