Generate ssa key¶
Generate SSH key and push to Github
ssh-keygen -o -a 100 -t ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
#copy public key with the following code: (mac only)
pbcopy < ~/.ssh/id_ecdsa.pub
#paste public key to github
ssh -T [email protected] # check green icon
#done
# From Git version 2.3.0, you can use the environment variable GIT_SSH_COMMAND like this:
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example
#Note that -i can sometimes be overridden by your config file, in which case, you should give SSH an empty config file, like this:
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example -F /dev/null" git clone example
#Configuration core.sshCommand:
#From Git version 2.10.0, you can configure this per repo or globally, so you don't have to set the environment variable any more!
git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"