Git push to github without password
how to move from https to git to push to github, using ssh keys to authenticate
By default everytime I push to github, I have a prompt asking for password.
(xgboost) guillaume@LL11LPC0PQARQ:~/git/guillaume_blog$ git push
Username for 'https://github.com': castorfou
Password for 'https://castorfou@github.com':
Everything up-to-date
Would be great if I could leverage ssh keys to authenticate.
From https://stackoverflow.com/questions/14762034/push-to-github-without-a-password-using-ssh-key,
For example, a GitHub project like Git will have an HTTPS URL:
https://github.com/<Username>/<Project>.git
And the SSH one:
git@github.com:<Username>/<Project>.git
You can do:
git remote set-url origin git@github.com:<Username>/<Project>.git
to change the URL.
In my case I have
(xgboost) guillaume@LL11LPC0PQARQ:~/git/guillaume_blog$ git remote -v
origin https://github.com/castorfou/guillaume_blog.git (fetch)
origin https://github.com/castorfou/guillaume_blog.git (push)
I have just to modify:
git remote set-url origin git@github.com:castorfou/guillaume_blog.git
It looks like working:
(xgboost) guillaume@LL11LPC0PQARQ:~/git/guillaume_blog$ git push
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.59 KiB | 812.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:castorfou/guillaume_blog.git
4013108..ae78b99 master -> master
To find a solution to use a proxy