Create ssh directory
mkdir ~/.ssh
mkdir ~/.ssh/github
mkdir ~/.ssh/devops
Create ssh key
ssh key for Github
ssh-keygen -t rsa -b 4096 -f ~/.ssh/github/${accountName}/id_rsa -C "test@mail.com"
ssh key for Azure DevOps
ssh-keygen -t rsa -b 4096 -f ~/.ssh/devops/${organizationName}/id_rsa -C "test@mail.com"
Create .ssh/config
vi ~/.ssh/config
Host github-${accountName}
HostName github.com
User git
AddKeysToAgent yes
IdentitiesOnly yes
UseKeychain yes
IdentityFile ~/.ssh/github/${accountName}/id_rsa
Host devops-${organizationName}
HostName ssh.dev.azure.com
User git
AddKeysToAgent yes
IdentitiesOnly yes
UseKeychain yes
IdentityFile ~/.ssh/devops/${organizationName}/id_rsa
Copy and paste public key to Github
pbcopy < ~/.ssh/github/${accountName}/id_rsa.pub
Copy and paste public key to AzureDevOps
pbcopy < ~/.ssh/devops/${organizationName}/id_rsa.pub
Clone repository
Github
git clone git@github-${accountName}:${accountName}/${projectName}.git
DevOps
git clone git@devops-${organizationName}:v3/${organizationName}/${projectName}