Skip to content

Instantly share code, notes, and snippets.

View kmarinoff's full-sized avatar
🏠
Working from home

Kaloyan Marinov kmarinoff

🏠
Working from home
View GitHub Profile
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active July 3, 2024 12:38
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active July 3, 2024 17:39
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.