John Doah
John Doah

Reputation: 1999

Push to GitHub repo with another user

I have on my Mac two GitHub users, one is for work and another is personal. I set them up following this tutorial: https://medium.com/@ibrahimlawal/developing-with-multiple-github-accounts-on-one-macbook-94ff6d4ab9ca

I created a repo with my personal account, and tried to do a push with the work account, and to my surprise, it let me do this. I thought it should stop me from doing it because the work user should not have access to the personal GitHub. How can I avoid it? I want to be able to push to a personal repo with only my personal account, and to my work repos only with my work account.

Upvotes: 1

Views: 45

Answers (1)

VonC
VonC

Reputation: 1329512

The article is about managing two different SSH keys.

But if you can push, it might be because:

  • you are using an HTTPS URL
  • your work account credentials were cached (git config credential.helper: probably credential-osxkeychain on Mac: see "clear all Git credentials").

Upvotes: 1

Related Questions