I generated an SSH key pair without a password and added the public key to GitHub.
Connection with
user@dev:/var/www/project# ssh -T [email protected] Hi User! You've successfully authenticated, but GitHub does not provide shell access.
was successful and when I rename the key, it fails.
But when I want to push my changes, it stills ask me for my username and password combination.
Is there a way to push without a password?
You can cache your GitHub password in Git: Just follow the instructions from GitHub's official documentation. After following the instructions from the above link, you should be able to push/pull to/from your repository without typing your username/password every time.
If it is asking you for a username and password, your origin remote is pointing at the HTTPS URL rather than the SSH URL.
Change it to ssh.
For example, a GitHub project like Git will have an HTTPS URL:
https://github.com/<Username>/<Project>.git
And the SSH one:
[email protected]:<Username>/<Project>.git
You can do:
git remote set-url origin [email protected]:<Username>/<Project>.git
to change the URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With