Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Matt Ruiz
Matt Ruiz

Posted on

Changing your Firebase CLI project

Hola hola,

TLDR

RetrievePROJECT ID by running:

  • firebase projects:list.

Once you have that id, run the following command:

  • firebase use {PROJECT ID}

Problem

As you work with projects, you'll notice that you will often have adev and aprod database instance.

You don't want to test new features on live user data so you create aduplicate of yourprod database.

Now that you have two projects, you're gonna' need to switch between them as you test and deploy your Cloud Cunctions (CF).

Imagine the following scenario:

  1. New CF feature A is being developed, tested, and deployed to thedev database/CF instances.
  2. Feature A is now ready to release to our Users.
  3. We need to now deploy the feature A updates to ourprod instances.

Solution

At this point, I will assume that you have installedFirebase CLI.

These projects have a uniquePROJECT ID that we use in our commands to switch projects.

First, we want to make get thatPROJECT ID. Do that by running:

  • firebase projects:list.

Once you have that id, run the following command:

  • firebase use {PROJECT ID}

If successful, you should see a message like:

  • Now using project {PROJECT_ID}

I hope that's helpful to some.

-Matt

Top comments(3)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
respect17 profile image
Kudzai Murimi
FullStack Developer and Content Writer
  • Location
    Capetown, South Africa
  • Joined

Thanks!

CollapseExpand
 
matthewzruiz profile image
Matt Ruiz
Head coder for Pencil Bible, Amplinks, and others.
  • Joined

Woah that was fast!

Glad it was helpful,@respect17

CollapseExpand
 
respect17 profile image
Kudzai Murimi
FullStack Developer and Content Writer
  • Location
    Capetown, South Africa
  • Joined

Yaaah,helpful thanks for sharing

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Head coder for Pencil Bible, Amplinks, and others.
  • Joined

More fromMatt Ruiz

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp