0

I have two github accounts, one for my own projects and another one for my companie's projects. In my mac I always have committed to my personal github account, which actually doesn't ask for username and/or password when pulling/pushing.

Is there a way to be able to switch between my personal account and my job account?

When I try to clone from my job's account I get the error

remote: Repository not found.

I guess the problem is that git is trying to clone using my personal account.

BRabbit27
  • 6,333
  • 17
  • 90
  • 161
  • Are you using SSH or HTTPS to talk to your remote repos on GitHub? –  Feb 20 '14 at 19:32
  • for every repository on your computer `git config --global user.email "your_email@example.com"` for a single repository `git config user.email "your_email@example.com"` – f-society Jul 08 '16 at 00:47

1 Answers1

0

If you're using SSH to pull and push to GitHub, then your personal account doesn't ask for username and password because you probably have them stored in your OS X keychain.

You can have more than one SSH keypair in your home ~/.ssh/ directory, and individual Git repos can be configured to use a different user from the global setting when committing by using git config user.email <work-email>.

If you search around on Google, you might be able to find instructions on how to configure an individual Git repo to use different SSH keys or HTTPS credentials from the global ones that you normally use for your personal account.