1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

herokuのデプロイ先リポジトリを変更する方法

1
Last updated at Posted at 2020-04-27

プログラミングを勉強中です。
herokuにいくつかリポジトリを作っており、新しいリポジトリにpushしたいタイミングでエラーとなってしまいました。

小さなエラーではありますが、今後の為に備忘録として残させていただきます。

状況

現在、ローカルでアプリケーションを開発中です。

開発の途中で、一度herokuにデプロイしていたのですが、
デプロイ済みのリポジトリではなく他のリポジトリにpushする必要がありました。

行ったこと

新しいリポジトリ(アプリケーションのデプロイ先)の作成

heroku create

必要ないかも知れませんが、herokuサイト上に記載があったので念のためgit init。

git init

その後、デプロイしたいアプリケーションを指定します。

heroku git:remote -a 【heroku createで作成されたアプリケーション名】

あとは通常通り、

git add .
git commit -m "コミットメッセージ"
git push heroku master

こちらでherokuへのデプロイできているかと・・・!

最後に

最後に、こちらのコマンドを打てば終了です!

heroku run rails:db:migrate
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?