Complete Guide: GitHub Multi-Account Setup (Personal + Company) on Windows
tutorials

Complete Guide: GitHub Multi-Account Setup (Personal + Company) on Windows

Learn the professional way to use personal and company GitHub accounts on the same Windows machine using SSH keys without conflicts.

Author

Md Mim Shifat

Full Stack Developer

2026-03-03 10 min read

Complete Guide: GitHub Multi-Account Setup (Personal + Company) on Windows

Author: Md Mim Shifat

Environment: Windows 10/11 + Git Bash + SSH

Goal: Use Personal and Company GitHub accounts on the same machine without conflicts.

Why This Setup Is Needed

When you use:

  • šŸ‘¤ Personal GitHub
  • šŸ¢ Company GitHub
  • On the same computer, two problems can happen:

    1. SSH authentication conflicts (wrong account pushes)

    2. Wrong commit author name/email

    This guide solves both issues properly using:

  • Separate SSH keys
  • SSH config file
  • Proper Git identity management
  • This is the professional way senior developers handle multiple GitHub accounts.


    PART 1 — Open Git Bash Properly

    Step 1 — Open Git Bash

    1. Click Windows Search šŸ”

    2. Type Git Bash

    3. Open it

    You should see something like:

    Bash
    MINGW64 ~

    That ~ means you are in:

    C:\Users\YourUsername

    Good — this is your home directory.


    PART 2 — Create .ssh Folder (Important)

    SSH keys are stored inside a hidden folder called .ssh.

    Step 2 — Create .ssh Folder

    Run:

    Bash
    mkdir -p ~/.ssh

    Now enter the folder:

    Bash
    cd ~/.ssh

    Verify your location:

    Bash
    pwd

    It must show:

    /c/Users/YourUsername/.ssh

    If yes → perfect.


    PART 3 — Create SSH Keys

    We will create:

  • id_personal → For personal GitHub
  • id_work → For company GitHub
  • Step 3 — Create Personal SSH Key

    Make sure you are inside .ssh.

    Run:

    Bash
    ssh-keygen -t ed25519 -C "your_personal_email@gmail.com"

    When it asks:

    Enter file in which to save the key:

    Type:

    id_personal

    Press Enter.

    When it asks for passphrase:

  • You can press Enter twice (no password)
  • Or set a passphrase (recommended for security)
  • You should see:

    Your identification has been saved in id_personal

    Your public key has been saved in id_personal.pub

    Step 4 — Create Work SSH Key

    Still inside .ssh, run:

    Bash
    ssh-keygen -t ed25519 -C "your_company_email@company.com"

    When it asks:

    Enter file in which to save the key:

    Type:

    id_work

    Press Enter twice (or set passphrase).

    Step 5 — Verify Keys

    Run:

    Bash
    ls -la

    You should see:

  • id_personal
  • id_personal.pub
  • id_work
  • id_work.pub
  • If yes → your keys are correctly created.


    PART 4 — Start SSH Agent

    SSH Agent manages your keys during the session.

    Step 6 — Start SSH Agent

    Bash
    eval "$(ssh-agent -s)"

    You should see:

    Agent pid 1234

    Step 7 — Add Keys to SSH Agent

    Bash
    ssh-add ~/.ssh/id_personal
    ssh-add ~/.ssh/id_work

    Verify:

    Bash
    ssh-add -l

    You should see two identities listed.


    PART 5 — Create SSH Config File

    This is the most important part.

    We must tell SSH:

  • When connecting as personal → use id_personal
  • When connecting as work → use id_work
  • Step 8 — Create Config File

    Open config file:

    Bash
    nano ~/.ssh/config

    Paste this exactly:

    text
    # Personal GitHub
    Host github-personal
       HostName github.com
       User git
       IdentityFile ~/.ssh/id_personal
       IdentitiesOnly yes
    
    # Work GitHub
    Host github-work
       HostName github.com
       User git
       IdentityFile ~/.ssh/id_work
       IdentitiesOnly yes

    Save:

    1. Press Ctrl + X

    2. Press Y

    3. Press Enter

    Done.


    PART 6 — Add Public Keys to GitHub

    Now we must register keys in GitHub.

    Add Personal Key

    Run:

    Bash
    cat ~/.ssh/id_personal.pub

    Copy the entire output.

    Go to:

    GitHub → Settings → SSH and GPG Keys → New SSH Key → Paste → Save

    Add Work Key

    Run:

    Bash
    cat ~/.ssh/id_work.pub

    Copy output → Add to your company GitHub account.


    PART 7 — Test Connection

    Test Personal

    Bash
    ssh -T git@github-personal

    If it asks:

    Are you sure you want to continue connecting (yes/no)?

    Type:

    yes

    Then you should see:

    Hi username! You've successfully authenticated...

    Test Work

    Bash
    ssh -T git@github-work

    Type yes if asked.

    If successful → setup complete.


    PART 8 — Clone Repositories Correctly

    Now cloning must use custom host names.

    Clone Personal Repository

    Bash
    git clone git@github-personal:your-username/repo.git

    Example:

    Bash
    git clone git@github-personal:mimshifat/small-projects.git

    Clone Company Repository

    Bash
    git clone git@github-work:company-org/repo.git

    Example:

    Bash
    git clone git@github-work:techcorp/backend-api.git

    āš ļø **Do NOT use github.com anymore.**

    Use github-personal or github-work.


    PART 9 — Git Commit Identity Setup

    SSH controls access.

    Git config controls commit author.

    Set Global (Personal Default)

    Run once:

    Bash
    git config --global user.name "Your Name"
    git config --global user.email "your_personal_email@gmail.com"

    Now all repos default to personal identity.

    Set Company Identity (Inside Company Repo Only)

    After cloning company repo:

    Bash
    cd repo-name
    git config user.name "company-username"
    git config user.email "your_company_email@company.com"

    This affects *only* that repository.

    Always Verify Identity

    Inside any repository:

    Bash
    git config --show-origin user.name
    git config --show-origin user.email
  • If it shows: file:.git/config → That means local company identity is active.
  • If it shows: file:C:/Users/YourUsername/.gitconfig → That means global (personal) identity is active.

  • Final Mental Model

    ComponentSSH Key
    ResponsibilityCan I push?
    ComponentSSH Config
    ResponsibilityWhich key to use?
    ComponentGit user.name
    ResponsibilityAuthor name
    ComponentGit user.email
    ResponsibilityAuthor email
    ComponentGlobal config
    ResponsibilityDefault identity
    ComponentLocal repo config
    ResponsibilityOverrides global

    šŸŽÆ Final Result

    After completing this guide, you now have:

    āœ” Separate SSH keys

    āœ” Separate GitHub authentication

    āœ” Separate commit identities

    āœ” No conflicts

    āœ” Professional multi-account workflow

    GitHub
    Git
    SSH
    Windows
    Tutorial