如何将现有的heroku应用程序拉到新位置进行开发?

发布于 2024-08-31 10:57:34 字数 439 浏览 4 评论 0原文

目前,我在另一台计算机上有最新版本的代码,我想用它来开发(家用计算机和笔记本电脑,供我外出时使用),我在笔记本电脑上为我的应用程序设置了heroku。现在我需要将我的代码关联到桌面上,以便我也可以从那里推送到 heroku。

这是我从桌面上得到的结果:

desktop:~/NetBeansProjects/onlinescheduler$ git pull heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

我无法执行 heroku create 因为这将创建一个单独的应用程序。如何将现有代码与heroku关联(或从中下载全新版本)?

执行此操作的命令是什么?

I currently have the latest version of my code on another computer that I want to develop from (Home computer and laptop for when I'm out and about) I set up heroku for my app on my laptop. Now I need to associate my code on my desktop so that I can push to heroku from there as well.

This is what I get from my desktop:

desktop:~/NetBeansProjects/onlinescheduler$ git pull heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

I can't do heroku create because that will create a separate app. How do I associated the existing code with (or pull down a brand new version from) heroku?

Whats the command to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

爱你是孤单的心事 2024-09-07 10:57:34

另外,如果您以前从未在另一台计算机上使用过 heroku,则需要先执行更多操作:

$ gem install heroku
$ heroku login
 [then enter your credentials] 
$ heroku keys:add [path to keyfile]

现在您可以克隆远程存储库:

$ git clone [email protected]:<heroku_app>.git <local_directory>

Also, If you've never used heroku before on the other machine, you'll need to do a few more things first:

$ gem install heroku
$ heroku login
 [then enter your credentials] 
$ heroku keys:add [path to keyfile]

Now you can clone the remote repository:

$ git clone [email protected]:<heroku_app>.git <local_directory>
岛歌少女 2024-09-07 10:57:34

首先,您需要遵循 Heroku 的快速入门说明,您可以直接从马口中获得该说明,就在这里:https://devcenter.heroku.com/articles/quickstart

完成第 3 步后,请返回此处。

然后,您可以在命令行中输入:
heroku git:clone -a myapp

这里描述了:
https://devcenter.heroku.com/articles/git-clone-heroku-app

然后,如果您也想获取数据库,这里有一些选项。
有关导入/导出的较新 Heroku 说明:
https://devcenter.heroku.com/articles/heroku-postgres-import-export

有关推拉的旧版 Heroku 说明: https://blog.heroku .com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku

如果您使用 mongo,这是同步 mongo 数据库的有用工具:https://github.com/pedro/heroku-mongo-sync#readme

First of all, you'll want to follow the Quick Start instructions for Heroku, which you can get straight from the horse's mouth, right here: https://devcenter.heroku.com/articles/quickstart

Once you've gotten through step 3, come back here.

Then, you can type this into the command line:
heroku git:clone -a myapp

This is described here:
https://devcenter.heroku.com/articles/git-clone-heroku-app

Then, if you want to grab the database too, here are some options.
Newer Heroku instructions on import/export:
https://devcenter.heroku.com/articles/heroku-postgres-import-export

Older heroku instructions on push and pull: https://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku

If you are using mongo, this is a useful tool to sync your mongo database: https://github.com/pedro/heroku-mongo-sync#readme

扬花落满肩 2024-09-07 10:57:34

如果您首先需要从 Heroku 获取应用程序,请克隆您的应用程序。

为此,请在终端中写入:

heroku git:clone -a your_app_name

如果您已经拥有该应用程序和 heroku 的遥控器,请按照以下步骤操作。如果没有,您可以在此处查看说明 https://devcenter.heroku.com/articles/git

  1. 查找数据库的名称

在终端中写入:

heroku pg:info -a your_app_name

它将看起来像这样:

HEROKU_POSTGRESQL_MAROON_URL
  1. 查找本地数据库的名称

在 Rails 应用程序中,转到 config/database.yml

它将看起来像这样:

your_app_name_development
  1. 克隆您的生产数据库 (PostgreSQL)

在终端中写入您自己的数据库名称:

heroku pg:pull HEROKU_POSTGRESQL_MAROON_URL your_app_name_development -a your_app_name

HEROKU_POSTGRESQL_MAROON_URL 是生产数据库名称的示例(在 Heroku 中):
my_app_name_development 是您的开发数据库的名称(本地)
the_name_of_my_app 是您的应用程序在 Heroku 中的名称,

不要忘记通过捆绑安装来完成此操作...

If you first need to get the app from Heroku, clone your app.

To do that, write in your Terminal:

heroku git:clone -a your_app_name

If you already have the app and the remote to heroku follow the next steps. If not, you can check instructions here https://devcenter.heroku.com/articles/git

  1. Find the name of your database

Write in your Terminal:

heroku pg:info -a your_app_name

it will look something like this:

HEROKU_POSTGRESQL_MAROON_URL
  1. Find the name of your local database

In your Rails app go to config/database.yml

it will look something like this:

your_app_name_development
  1. Clone your production database (PostgreSQL)

Write in your Terminal with your own database names:

heroku pg:pull HEROKU_POSTGRESQL_MAROON_URL your_app_name_development -a your_app_name

HEROKU_POSTGRESQL_MAROON_URL is an example of how could be the name of your production database (in Heroku):
my_app_name_development is the name of your development database (locally)
the_name_of_my_app is the name of your app in Heroku

Don't forget to finish this with bundle install...

一场春暖 2024-09-07 10:57:34

如果您已经准备好代码库并设置了heroku,请使用:

$ heroku git:remote -a your_heroku_app

这将允许您从新位置进行部署。
参考: https://devcenter.heroku.com/articles/git#creating -a-heroku-remote

If you already have your code base ready and have heroku setup, use:

$ heroku git:remote -a your_heroku_app

This will allow you to deploy from your new location.
Reference: https://devcenter.heroku.com/articles/git#creating-a-heroku-remote

倾城°AllureLove 2024-09-07 10:57:34

在新计算机中创建密钥后,您必须通过输入 heroku keys:add 上传新的 SSH 密钥。

Once you create a key in a new computer, you have to upload your new SSH key by typing heroku keys:add.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文