Using Unique SSH Keys for Multiple GitHub Accounts

A screenshot from a computer terminal window showing git access denied error with a “denied” stamp graphic overlaid on top.
GitHub doesn’t like multiple accounts. :(
cp ~/.gitconfig ~/.gitconfig-work
cp ~/.gitconfig ~/.gitconfig-personal
code ~/.gitconfig ~/.gitconfig-work ~/.gitconfig-personal
[includeIf "gitdir:~/work/**"]
path = ~/.gitconfig-work
[core]
sshCommand = ssh -i ~/.ssh/id_rsa -F /dev/null
A screenshot of the author’s final .gitconfig file.
A screenshot of the author’s .gitconfig-work file.
My .gitconfig-work file

--

--

--

Software engineer. Great British Baking Show enthusiast. Obsessed with Beat Saber. Powered by insatiable curiosity and too much Diet Coke.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Learning Python

Swift Programming Tutorial: Collection Types — Arrays, Set, and Dictionaries

Coding Competitions

Step by Step Guide for the Data Migration of WSo2 EI Analytics from DAS to SP

HTTPS LAYER 7 Load Balancing on Google Cloud with Cloud CDN

Setting Up Cloud SIEM at scale — Deploying SumoLogic on AWS. Part 1

Hard To Program When we’re new in the field.

CucumberStudio - Agile test management tool

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amanda Reilly

Amanda Reilly

Software engineer. Great British Baking Show enthusiast. Obsessed with Beat Saber. Powered by insatiable curiosity and too much Diet Coke.

More from Medium

Passwords 101

Setup guide and introduction for Zsh and Oh-My-Zsh in Ubuntu(Include Powerlevel10k)

A schematic diagram for an architecture of operating system.

How to Install OpenSpeedTest on Docker with Portainer

CCIE Ep.15 0p3nSent.bgp-4_Do0r179