SSH authentication
SSH keys provide a secure way for Git to authenticate to GitHub without repeatedly entering an account password. The private key stays on your machine while the public key is registered with GitHub.
Protect the private key
Never upload a private SSH key to GitHub or place it in a repository. Use an SSH agent or operating-system credential facilities where appropriate.
Verify the connection
After configuring a key, test the SSH connection before changing repository remotes. This separates authentication problems from Git repository problems.