I need to do this on every new machine. So I keep a note for my quick reference.
Here are the links for the detailed configurations and so on.
$ ssh-keygen -t ed25519 -C "firstname.lastname@example.org"
You will be asked about the secure passphrase. I prefer letting it empty. Otherwise you need to enter this password every time you
$ eval "$(ssh-agent -s)": Test whether the SSH agent work or not.
$ ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub: copy the output of this command
- Go to the GitHub personal setting -> “SSH and GPG keys” on the left panel -> “New SSH key” -> Paste the above output to the input.
ssh -T email@example.com.
1 2 3 4 5
The authenticity of host 'github.com (126.96.36.199)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,188.8.131.52' (RSA) to the list of known hosts. Hi <your_username>! You've successfully authenticated, but GitHub does not provide shell access.
Change the Local Repo’s Remote Address
Assume your project is
awesome-project, then edit
url = https://<your_github_username>@github.com/<your_github_username>/awesome-project.git
url = firstname.lastname@example.org:<your_github_username>/awesome-project.git
Now you don’t need to enter password again when
git push or