Overview
Cheetsheet of How to set up for ssh to github comfortably.
(macbook買い直した時などgithubを爆速で設定する方法)
Make ssh keys
$ ssh-keygen -t rsa -b 4096 -C "your email(registerd at github)"
Enter a file name and a passphrase
when a file name is as follows
~/.ssh/github_rsa
Register pub key with github
$ pbcopy < ~/.ssh/github_rsa.pub
in github.com
at Setting
> SSH and GPG keys
> New SSH key
paste pub key and name it
Avoid Enter passphrase for key
Add ssh config
$ vim ~/.ssh/config
Host *
UseKeychain yes
Host github github.com
HostName github.com
IdentityFile ~/.ssh/github_rsa
User git
Add ssh key with
$ ssh-add -K ~/.ssh/github_rsa
※ -K Store passphrases in your keychain.
Check
$ ssh -T git@github.com