How do I switch apps from the firebase cli?

后端 未结 8 626
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-23 09:12

This seems like something which should be pretty easy to do, but for whatever reason, I\'m being defeated.

I\'m trying to use the firebase-tools CLI to interact with

相关标签:
8条回答
  • 2020-12-23 09:39

    Found some useful information here Firebase CLI Reference.

    The following code works for me.

    firebase use <project_id>
    
    0 讨论(0)
  • 2020-12-23 09:42

    Answer in 2020:

    The officially recommended way is to use "alias":

    In your .firebaserc, set the different project IDs:

    {
      "projects": {
        "production": "my-project-id",
        "testing": "my-project-id--testing"
      }
    }
    // you can also add these interactively with `firebase use --add`
    

    Then you can do firebase use testing or firebase use production to switch between projects.

    Note that switching projects won't create any git diff, it's simply remembered in your local machine. To see which project is currently being used, do firebase use.

    If you want to change the project ID without committing changes to the project owner's .firebaserc, do firebase use my-project-id locally as mentioned in the accepted answer. On the other hand, if you're the project owner and want others to use their own project IDs, you should add .firebaserc into .gitignore.

    0 讨论(0)
提交回复
热议问题