Git SSH Credentials
-
Generate SSH key pair
Terminal window ssh-keygen -t ed25519 -C "your_email@example.com" -f ~/.ssh/github_keyssh-keygen -t ed25519 -C "your_email@example.com" -f ~/.ssh/gitlab_keyssh-keygen -t ed25519 -C "your_email@example.com" -f ~/.ssh/azure_key -
Add the public keys (.pub) to your Git providers.
-
Add the key to
~/.ssh/config:# github - my accountHost github.comAddKeysToAgent yesUseKeychain yesIdentityFile ~/.ssh/github_key# gitlab - my accountHost gitlab.comAddKeysToAgent yesUseKeychain yesIdentityFile ~/.ssh/gitlab_key# azure - my acountHost ssh.dev.azure.comAddKeysToAgent yesUseKeychain yesIdentityFile ~/.ssh/azure_key -
Add keys to keychain
Terminal window ssh-add --apple-use-keychain ~/.ssh/github_keyssh-add --apple-use-keychain ~/.ssh/gitlab_keyssh-add --apple-use-keychain ~/.ssh/azure_key -
Test connection
Terminal window ssh -T git@github.comssh -T git@gitlab.comssh -T git@ssh.dev.azure.com