Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1958356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:18:22+00:00 2026-05-17T08:18:22+00:00

Trying to work on both my actual "work" repos, and my repos on GitHub,

  • 0

Trying to work on both my actual "work" repos, and my repos on GitHub, from my computer.

The work account was set up first, and everything works flawlessly.

My account, however, cannot seem to push to my repo, which is set up under a different account/email.

I’ve tried copying my work key up to my account, but that throws an error because of course a key can only be attached to one account.

How can I push/pull to and from both accounts with their respective GitHub credentials?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T08:18:22+00:00Added an answer on May 17, 2026 at 8:18 am

    All you need to do is configure your SSH setup with multiple SSH keypairs.

    • This link is easy to follow (Thanks Eric):

      http://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts–net-22574

    • Generating SSH keys (Win/msysgit):

      https://help.github.com/articles/generating-an-ssh-key/

    Relevant steps from the first link:

    1. Generate an SSH-key:

      ssh-keygen -t ed25519 -C "john@doe.example.com"
      

      Follow the prompts and decide a name, e.g. id_ed25519_example_company.

    2. Copy the SSH public-key to GitHub from ~/.ssh/id_ed25519_doe_company.pub and tell ssh about the key:

      ssh-add ~/.ssh/id_ed25519_doe_company
      
    3. Create a config file in ~/.ssh with the following contents:

      Host github-doe-company
        HostName github.com
        User git
        IdentityFile ~/.ssh/id_ed25519_doe_company
      
    4. Add your remote:

      git remote add origin git@github-doe-company:username/repo.git
      

      or change using:

      git remote set-url origin git@github-doe-company:username/repo.git
      

    Also, if you’re working with multiple repositories using different personas, you need to make sure that your individual repositories have the user settings overridden accordingly:

    Setting user name, email and GitHub token – Overriding settings for individual repos
    https://help.github.com/articles/setting-your-commit-email-address-in-git/

    Note:
    Some of you may require different emails to be used for different repositories, from git 2.13 you can set the email on a directory basis by editing the global config file found at: ~/.gitconfig using conditionals like so:

    [user]
        name = Default Name
        email = defaultemail@example.com
    
    [includeIf "gitdir:~/work/"]
        path = ~/work/.gitconfig
    

    And then your work-specific config ~/work/.gitconfig would look like this:

    [user]
        name = Pavan Kataria
        email = pavan.kataria@example.com
    

    Thank you @alexg for informing me of this in the comments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying ajax for the first time but it doesn't work. This is some.php
I'm trying to write a regex to match the first attribute before both :
I'm trying to find an HTML templating solution that will work both on my
Programming Student here...trying to work on a project but I'm stuck. The project is
I have been trying to work my way through Project Euler, and have noticed
Weve recently been trying to work on an application that uses pandastream to encode
I'm trying to work through Project Euler and I'm hitting a barrier on problem
I'm trying to work through the problems on projecteuler.net but I keep running into
I'm trying to work my way through Ron Jeffries's Extreme Programming Adventures in C#.
I am trying to work out the best database model for the current setup:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.