0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CLIでFirebaseのプロジェクトを確認したりデフォルトのプロジェクトを切り替えたりする

Posted at

複数のプロジェクトを同時並行でつくっていて、デプロイ先を間違えて困ったので備忘録

まず、今あるプロジェクトの一覧を出す

firebase projects:list

これね

んで、デフォルトのプロジェクトを切り替える

firebase use XXXXX

これでおk

また、firebaseのリソース逼迫を避けるため、書き換えたコードだけdeployする方法はとかもろもろ以下

よく使うパターン
Hosting だけデプロイ(Functions 等は触らない)

firebase deploy --only hosting

複数ホスティングターゲットのうち特定だけ
(firebase.json で hosting を複数定義している場合)
firebase deploy --only hosting:<ターゲット名>

firebase deploy --only hosting:XXXX

逆に「Functions だけ」「特定の Function だけ」
Functions 全部

firebase deploy --only functions

特定の関数だけ

firebase deploy --only functions:setUserClaim

いくつかの製品だけまとめて

Hosting と Firestore だけ

firebase deploy --only hosting,firestore

“除外” 指定(except)
Functions を除いて他は全部

firebase deploy --except functions

プレビュー用の一時 URL へ(本番を触らず動作確認)
firebase hosting:channel:deploy <任意のチャンネル名>

firebase hosting:channel:deploy preview-20250914

小ワザ(事故防止)
現在のデプロイ先プロジェクト確認:

firebase use

切り替え(または alias 設定):

firebase use
初回は

firebase use --add
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?