source: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent # Generating a new SSH key ssh-keygen -t ed25519 -C "your_email@example.com" # Adding your SSH key to the ssh-agent eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 # Adding a new SSH key to your GitHub account https://github.com # Testing your SSH connection ssh -T git@github.com # clone your github repository by ssh's link git clone git@github.com:xxx/xxx.git # View the existing remotes git remote -v # set a remote SSH URL in git git remote set-url origin git@github.com:xxxx/xxxx.git git remote -v # done git init git add . git commit "update" git push