<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Madhan Gannarapu</title>
    <description>The latest articles on DEV Community by Madhan Gannarapu (@madhan_gannarapu).</description>
    <link>https://dev.to/madhan_gannarapu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F905389%2Fd704f253-00ee-4c05-8b65-30997c7176a5.jpeg</url>
      <title>DEV Community: Madhan Gannarapu</title>
      <link>https://dev.to/madhan_gannarapu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/madhan_gannarapu"/>
    <language>en</language>
    <item>
      <title>Firebase &amp; FlutterFire Recommended Multi-Account Setup</title>
      <dc:creator>Madhan Gannarapu</dc:creator>
      <pubDate>Mon, 08 Jun 2026 20:19:47 +0000</pubDate>
      <link>https://dev.to/madhan_gannarapu/firebase-flutterfire-recommended-multi-account-setup-bj</link>
      <guid>https://dev.to/madhan_gannarapu/firebase-flutterfire-recommended-multi-account-setup-bj</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;This guide describes the recommended setup for developers working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Personal Firebase Projects (&lt;code&gt;personal@gmail.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Company Firebase Projects (&lt;code&gt;employee@company.com&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid frequent login/logout cycles&lt;/li&gt;
&lt;li&gt;Switch accounts quickly&lt;/li&gt;
&lt;li&gt;Manage multiple Firebase environments&lt;/li&gt;
&lt;li&gt;Keep FlutterFire configuration simple&lt;/li&gt;
&lt;li&gt;Use an officially supported Firebase workflow&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Architecture
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Google Accounts
├── personal@gmail.com
└── employee@company.com

Firebase CLI
├── login:add
├── login:list
└── login:use

Firebase Projects
├── personal-app
├── company-dev
├── company-qa
└── company-prod

Project Aliases
├── dev
├── qa
└── prod

Shell Aliases
├── firebase-personal
└── firebase-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 1: Install Firebase CLI
&lt;/h1&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; firebase-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 2: Install FlutterFire CLI
&lt;/h1&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dart pub global activate flutterfire_cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 3: Add Multiple Firebase Accounts
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Add Personal Account
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;personal@gmail.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Add Company Account
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee@company.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Verify Accounts
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✔ personal@gmail.com
✔ employee@company.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 4: Create Shell Aliases
&lt;/h1&gt;

&lt;p&gt;Instead of typing long email addresses repeatedly, create aliases.&lt;/p&gt;

&lt;p&gt;Open:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;firebase-personal&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"firebase login:use personal@gmail.com"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;firebase-company&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"firebase login:use employee@company.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 5: Test Account Switching
&lt;/h1&gt;

&lt;p&gt;Switch to personal account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase projects:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Switch to company account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase projects:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 6: Configure Firebase Project Aliases
&lt;/h1&gt;

&lt;p&gt;Navigate to your Flutter project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;my-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add development project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use &lt;span class="nt"&gt;--add&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project:
company-dev

Alias:
dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Add QA project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use &lt;span class="nt"&gt;--add&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project:
company-qa

Alias:
qa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Add Production project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use &lt;span class="nt"&gt;--add&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project:
company-prod

Alias:
prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Generated file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.firebaserc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"projects"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"company-dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"qa"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"company-qa"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prod"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"company-prod"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 7: Verify Project Aliases
&lt;/h1&gt;

&lt;p&gt;Switch environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use qa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check active project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 8: Generate FlutterFire Configurations
&lt;/h1&gt;

&lt;p&gt;Development:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire configure &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;company-dev &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lib/firebase_options_dev.dart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;QA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire configure &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;company-qa &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lib/firebase_options_qa.dart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Production:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire configure &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;company-prod &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lib/firebase_options_prod.dart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lib/
├── firebase_options_dev.dart
├── firebase_options_qa.dart
└── firebase_options_prod.dart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 9: Configure Firebase Initialization
&lt;/h1&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'firebase_options_dev.dart'&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'firebase_options_prod.dart'&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;prod&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;isProd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromEnvironment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'PROD'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Firebase&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initializeApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;options:&lt;/span&gt; &lt;span class="n"&gt;isProd&lt;/span&gt;
      &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;prod&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DefaultFirebaseOptions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentPlatform&lt;/span&gt;
      &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DefaultFirebaseOptions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentPlatform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Daily Workflow
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Working on Personal Project
&lt;/h2&gt;

&lt;p&gt;Switch account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase projects:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure FlutterFire if required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Working on Company Development Environment
&lt;/h2&gt;

&lt;p&gt;Switch account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutterfire configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Working on Company QA Environment
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-company
firebase use qa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Working on Company Production Environment
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-company
firebase use prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Troubleshooting
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Show Logged-In Accounts
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Show Available Projects
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase projects:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Show Current Active Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Remove an Account
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase &lt;span class="nb"&gt;logout &lt;/span&gt;employee@company.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Why This Setup Is Recommended
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Firebase Multi-Account Support
&lt;/h3&gt;

&lt;p&gt;Uses Firebase's officially supported mechanism:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple Google accounts supported&lt;/li&gt;
&lt;li&gt;No repeated browser authentication&lt;/li&gt;
&lt;li&gt;Secure credential management&lt;/li&gt;
&lt;li&gt;Works across all Firebase CLI commands&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Shell Aliases
&lt;/h3&gt;

&lt;p&gt;Provides faster switching:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase-personal
firebase-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:use personal@gmail.com
firebase login:use employee@company.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster workflow&lt;/li&gt;
&lt;li&gt;Less typing&lt;/li&gt;
&lt;li&gt;Fewer mistakes&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Recommendation
&lt;/h1&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Firebase Multi-Account Support
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase login:add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Firebase Project Aliases
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firebase use &lt;span class="nt"&gt;--add&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Shell Aliases
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;firebase-personal&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"firebase login:use personal@gmail.com"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;firebase-company&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"firebase login:use employee@company.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This combination provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official Firebase account management&lt;/li&gt;
&lt;li&gt;Fast account switching&lt;/li&gt;
&lt;li&gt;Environment management (Dev / QA / Prod)&lt;/li&gt;
&lt;li&gt;FlutterFire compatibility&lt;/li&gt;
&lt;li&gt;Minimal maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interactive shell scripts are optional and are only worth adding if you switch accounts and environments many times throughout the day.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>flutter</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>What Is CORS and Why Is It Breaking My API Requests?</title>
      <dc:creator>Madhan Gannarapu</dc:creator>
      <pubDate>Fri, 01 Aug 2025 11:32:48 +0000</pubDate>
      <link>https://dev.to/madhan_gannarapu/what-is-cors-and-why-is-it-breaking-my-api-requests-38n4</link>
      <guid>https://dev.to/madhan_gannarapu/what-is-cors-and-why-is-it-breaking-my-api-requests-38n4</guid>
      <description>&lt;p&gt;If you’ve ever built a web app that talks to a backend API, you’ve probably run into this scary message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ “Access to fetch at ‘some-api.com’ from origin ‘your-site.com’
has been blocked by CORS policy...”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sounds confusing? Don’t worry — this article will explain what CORS is, why it exists, and how to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Problem: Different Origins
&lt;/h2&gt;

&lt;p&gt;Let’s say:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your frontend is hosted at: &lt;a href="https://mycoolapp.com" rel="noopener noreferrer"&gt;https://mycoolapp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Your backend API lives at: &lt;a href="https://api.mycoolapp.com" rel="noopener noreferrer"&gt;https://api.mycoolapp.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though they look similar, the browser sees them as different places, called origins.&lt;/p&gt;

&lt;p&gt;An origin is made up of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;Origin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If any of these are different, the browser treats it as a cross-origin request&lt;/p&gt;

&lt;p&gt;And that’s when CORS steps in.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What is CORS?
&lt;/h2&gt;

&lt;p&gt;CORS stands for Cross-Origin Resource Sharing.&lt;/p&gt;

&lt;p&gt;It’s a security rule built into all modern browsers that says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I’ll only let your website fetch data from another origin if that origin allows it.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That means — even if your API is working fine, the browser can still block your request unless the API sends back the right permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does the Browser Do This?
&lt;/h2&gt;

&lt;p&gt;It’s there to protect users.&lt;/p&gt;

&lt;p&gt;Imagine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re logged into your bank.&lt;/li&gt;
&lt;li&gt;You visit a shady site.&lt;/li&gt;
&lt;li&gt;That site secretly tries to make a request to your bank using your login session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without CORS, the shady site could potentially succeed.&lt;/p&gt;

&lt;p&gt;So browsers add a safety check:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“You can’t send requests to other websites unless they clearly say it’s okay”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When Do CORS Errors Happen?
&lt;/h2&gt;

&lt;p&gt;CORS errors usually happen when your website tries to talk to another origin. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ Your site: https://example.com

❌ Tries to call:
- http://example.com        (different protocol)
- https://api.example.com   (different subdomain)
- https://backend.com       (different domain)
- https://example.com:8080  (different port)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other reasons CORS might fail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The backend doesn’t return the correct CORS headers&lt;/li&gt;
&lt;li&gt;You’re sending Authorization headers or cookies&lt;/li&gt;
&lt;li&gt;You’re using PUT, DELETE, or custom headers — which triggers a preflight request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the browser doesn’t get permission, it blocks the request.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s a Preflight Request?
&lt;/h2&gt;

&lt;p&gt;A preflight request is like asking for permission before doing something sensitive.&lt;br&gt;
Let’s say your frontend wants to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the PUT method&lt;/li&gt;
&lt;li&gt;Send application/json data&lt;/li&gt;
&lt;li&gt;Include a token in headers
The browser says:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Hold on! Let me check with the server first.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So it sends an hidden OPTIONS request - this is called “preflight.”&lt;br&gt;
If the server replies properly, your request goes through ✅&lt;br&gt;
If not, the browser blocks it 💥&lt;/p&gt;
&lt;h2&gt;
  
  
  How the OPTIONS Request Works
&lt;/h2&gt;

&lt;p&gt;Browser sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPTIONS /api/user HTTP/1.1  
Origin: https://mycoolapp.com  
Access-Control-Request-Method: PUT  
Access-Control-Request-Headers: Content-Type, Authorization  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Server must respond:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Access-Control-Allow-Origin: https://mycoolapp.com  
Access-Control-Allow-Methods: GET, POST, PUT, DELETE  
Access-Control-Allow-Headers: Content-Type, Authorization  
Access-Control-Allow-Credentials: true  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the server doesn’t send these headers, the request will be blocked.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Fix CORS
&lt;/h2&gt;

&lt;p&gt;If you control the backend, here’s what you need to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow your frontend’s origin&lt;/li&gt;
&lt;li&gt;Handle the OPTIONS method&lt;/li&gt;
&lt;li&gt;Allow necessary headers and methods&lt;/li&gt;
&lt;li&gt;If you’re using cookies or auth tokens, set Access-Control-Allow-Credentials: true&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example: Fixing CORS in Node.js (Express)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cors&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://mycoolapp.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="c1"&gt;// allow your frontend&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;PUT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DELETE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OPTIONS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                        &lt;span class="c1"&gt;// allow cookies/tokens&lt;/span&gt;
  &lt;span class="na"&gt;allowedHeaders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Handle preflight&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Quick Troubleshooting Checklist
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ CORS Debugging Checklist

✅ Check                                  | Example
------------------------------------------|---------------------------------------------------
Is the origin allowed?                    | Access-Control-Allow-Origin: https://mycoolapp.com
Are custom headers allowed?               | Authorization, X-Custom-Header
Is the preflight request handled?         | Allow OPTIONS requests
Are credentials (cookies/tokens) enabled? | Access-Control-Allow-Credentials: true
Are you using * with credentials?         | ❌ Not allowed. Use exact origin instead
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>api</category>
      <category>websecurity</category>
      <category>cors</category>
      <category>devchallenge</category>
    </item>
    <item>
      <title>Managing Multiple Git Accounts on One Machine(Mac/Linux)</title>
      <dc:creator>Madhan Gannarapu</dc:creator>
      <pubDate>Fri, 04 Jul 2025 08:47:08 +0000</pubDate>
      <link>https://dev.to/madhan_gannarapu/managing-multiple-git-accounts-on-one-machine-83l</link>
      <guid>https://dev.to/madhan_gannarapu/managing-multiple-git-accounts-on-one-machine-83l</guid>
      <description>&lt;p&gt;How to set up and manage personal and work Git accounts on your local machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Introduction
&lt;/h2&gt;

&lt;p&gt;Many developers work with both personal and work GitHub accounts. Here's how to manage them on a Mac...&lt;/p&gt;

&lt;h2&gt;
  
  
  What You’ll Learn
&lt;/h2&gt;

&lt;p&gt;✅ Use SSH to separate identities&lt;br&gt;
✅ Automatically apply correct Git user config based on folder&lt;br&gt;
✅ Clean directory structure&lt;/p&gt;
&lt;h2&gt;
  
  
  📁 Directory Setup
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/
├── .ssh/
│   ├── work/
│   │   ├── id_ed25519_work
│   │   ├── id_ed25519_work.pub
│   ├── personal/
│   │   ├── id_ed25519_personal
│   │   ├── id_ed25519_personal.pub
│   └── config               # SSH config file
├── .gitconfig
├── .gitconfig-work          # Workspace-specific Git config
├── .gitconfig-personal      # Personal Git config
├── work/                    # All workspace (work) repositories
└── personal/                # All personal repositories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Set Up Personal and Work
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir personal work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;personal&lt;/code&gt;: Use this folder for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your own apps, portfolios&lt;/li&gt;
&lt;li&gt;Open source contributions&lt;/li&gt;
&lt;li&gt;Learning new tech, coding experiments&lt;/li&gt;
&lt;li&gt;Resume or portfolio projects&lt;/li&gt;
&lt;li&gt;Hackathons or fun builds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;work&lt;/code&gt;: Use this folder for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;company apps/repos&lt;/li&gt;
&lt;li&gt;poc apps&lt;/li&gt;
&lt;li&gt;Anything related to employment&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Generate SSH Keys for Each Git Account
&lt;/h2&gt;

&lt;p&gt;Generate a unique SSH key for each GitHub or GitLab account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal
ssh-keygen -t ed25519 -C "your-email@personal.com" -f ~/.ssh/personal/id_ed25519_personal

# Work
ssh-keygen -t ed25519 -C "your-email@company.com" -f ~/.ssh/work/id_ed25519_work

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Add the SSH keys to the ssh-agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal
ssh-add ~/.ssh/personal/id_ed25519_personal

# Work
ssh-add ~/.ssh/work/id_ed25519_work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add SSH Keys to Your GitHub Accounts (Company &amp;amp; Personal)
&lt;/h2&gt;

&lt;p&gt;Once you've generated the SSH keys, you need to add the public keys to your respective GitHub accounts so they can recognize and authorize your machine&lt;br&gt;
To view the SSH keys in terminal run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal
cat ~/.ssh/personal/id_ed25519_personal.pub

# work
cat ~/.ssh/work/id_ed25519_work.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure the SSH Config File
&lt;/h2&gt;

&lt;p&gt;Create or update your ~/.ssh/config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch ~/.ssh/config
open ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal
Host github.com-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/personal/id_ed25519_personal

# Work
Host github.com-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/work/id_ed25519_work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;github.com-personal&lt;/code&gt; or &lt;code&gt;github.com-work&lt;/code&gt; as the remote URL host.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification SSH with GitHub accounts
&lt;/h2&gt;

&lt;p&gt;To verify SSH works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -T git@github-work
ssh -T git@github-personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expect messages like: “Hi ! You've successfully authenticated...”&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure the Global&lt;code&gt;.gitconfig&lt;/code&gt; File
&lt;/h2&gt;

&lt;p&gt;Create two custom Git configs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal Git config
touch ~/.gitconfig-personal

# Work Git config
touch ~/.gitconfig-work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open and fill them like this:&lt;br&gt;
~/.gitconfig-personal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
  name = Madhan Gannarapu
  email = your-email@personal.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;~/.gitconfig-work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
  name = Madhan Gannarapu
  email = your-email@company.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use Conditional Includes in Global &lt;code&gt;.gitconfig&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Create or update your &lt;code&gt;~/.ssh/config&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch ~/.ssh/config
open ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
  name = Default Madhan
  email = default@example.com

[includeIf "gitdir:~/work/**"]
  path = ~/.gitconfig-work

[includeIf "gitdir:~/personal/**"]
  path = ~/.gitconfig-personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This config tells Git to automatically use different identity files depending on which directory the repo is in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clone Repos with Correct SSH Host
&lt;/h2&gt;

&lt;p&gt;Use the matching host from your &lt;code&gt;~/.ssh/config&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Personal
git clone git@github.com-personal:username/repo.git ~/Projects/personal/repo

# Work
git clone git@github.com-work:company/repo.git ~/Projects/work/repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>github</category>
      <category>productivity</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
