How to Properly Manage Multiple SSH Keys for Git on Your Local Environment

Photo by Yancy Min on Unsplash

Basic Use Case: deploy keys for a single repository

ssh-keygen -t ed25519 -C ""
cd ~/.ssh/
git fetch
Deploy Keys on

Advanced Use Case: multiple deploy keys for multiple repositories

nano ~/.ssh/config
IdentityFile ~/.ssh/key_project1
IdentityFile ~/.ssh/key_project2
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*
git fetch


ssh-add -D
ssh -v

What’s Next

Freelance IT Project Manager | Writer for The Startup and DataDrivenInvestor | 📍Paris

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