Setup git to use Keychain

When I’m writing code I often need to send my committs to a remote repository. I’m using GitHub and also Azure DevOps depending on the project.

It can be frustrating at first to successfully begin sending commits to those repo services and also to automate authentication where you don’t need to enter a password on each Git push.

For anyone feeling frustrated, I’ve outlined steps I’ve taken to begin commtting to a cloud repo and also automating user authentiction.

OS

If you’re running Windows and using Azure Repos (a component of Azure DevOps) I’ve found using their PAT (Personal Access Tokens) to be the easiest, however you could still follow the below steps.

For Mac OS X it’s also possible to

Add your private key to Keychain

ssh-add -K <private key path>

Configure SSH to use keychain

In your ~/.ssh/config

Now start developing!

From here you should be able to authenticate into your remote repo and do git pulls and pushes, etc.

Mike Shannon
Mike Shannon
Web/Software Engineer