覆盖现有的 Heroku 应用程序 [英] Overwriting an existing Heroku app
问题描述
我有一个 Sinatra 应用,托管在 Heroku 上.最近,我一直在从不同的文件夹开发相同的应用程序.它不是一个分支,它只是一个内容相同但代码不同的并行应用程序/目录.我想将这个新应用程序推送到 Heroku,覆盖当前存在的应用程序.我不想在本地合并两者,只需在保留旧的同时从新的继续.什么是正确的命令序列?我对运行 heroku create
有疑问,因为这会产生一个新的应用程序.谢谢!
I have a Sinatra app, hosted on Heroku. Lately, I've been developing that same app from a different folder. It's not a branch, it's just a parallel app / directory with identical contents but different code. I want to push this new app to Heroku, overwriting the app that's currently there. I don't want to merge the two locally, just continue from the new one while keeping the old. What's the proper command sequence for this? I have doubts about running heroku create
, as that will result in a new app. Thanks!
推荐答案
首先,这当然是可能的.过程非常简单,首先我们需要将 Heroku 作为新的远程存储库添加到您的新应用中.
Firstly this is certainly possible. The process is quite simple, firstly we need to add Heroku as a new remote repository to your new app.
heroku git:remote -a project
您可以将项目"替换为您的 Heroku 应用程序名称.其次,您需要强制推送到 Heroku.
You would replace the 'project' with your Heroku app name. Secondly you would need to force a push to Heroku.
git push -f heroku master
注意:我们使用-f"来强制推送.
Note: We are using an '-f' to force the push.
这篇关于覆盖现有的 Heroku 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!