Skip to content

Instantly share code, notes, and snippets.

View shynline's full-sized avatar
👀
“Make it work, make it right, make it fast.” – Kent Beck

Shayan Sabahi shynline

👀
“Make it work, make it right, make it fast.” – Kent Beck
View GitHub Profile
@shynline
shynline / work-with-multiple-github-accounts.md
Created August 28, 2024 11:10 — forked from rahularity/work-with-multiple-github-accounts.md
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
@shynline
shynline / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md How to configure multiple deploy keys for different private github repositories on the same computer

This is probably a common issue for people who wants to deploy serveral repository on one VPS or VM.

This is not going to be rocket science.

The first step is to generate your first ssh key, for this type the following command line in your terminal: ssh-keygen -t rsa -b 4096 -C "your@email.com" When the command CLI is asking you if you want to use a passphrase you might want to press ENTER in order to don't have to type it everytime you will want to pull your repository.

Now copy the content of your public key and add it to Github in your first repository (Settings > Deploy keys). For example on debian it might be: