2
I can push to git@github.com:wting/repo.git
links without a password prompt since it's using my ssh-agent. However when I push to https://github.com/wting/repo.git
it always asks for username and password.
The issue can somewhat be alleviated by using password caching, but I'd rather not use that.
This mainly pops up when using gists because they only show an https link (e.g. https://gist.github.com/123.git
). I don't want to modify the URL of every gist I clone to use the git@gist.github.com:123.git
version.
How do I set it up so that git uses my ssh-agent when pushing to an https address?
Relevant URL: Why does GitHub recommend HTTPS over SSH?
I already have the SSH keys added to my account. I'm asking how to get it working with https links and not just git@github.com links. – wting – 2013-01-19T17:22:36.010
Why not just use the Git link? Gists might not support R+W access... – Tamara Wijsman – 2013-01-19T17:25:03.023
Gists do support r+w access, but only the https link is shown. I would rather not have to modify the clone link every time I clone a gist. – wting – 2013-01-19T17:27:53.670
@WilliamTing: Oh right, just checked and works here. I believe this to be a local problem and thus not related to GitHub, please double check your configuration and follow the relevant steps again... Is there a firewall in the way? – Tamara Wijsman – 2013-01-19T17:29:21.360
You can push to https using ssh-agent? There's no firewall in the way. – wting – 2013-01-19T17:31:11.410
I'm testing with this simple gist. There is only the "master" branch.
– wting – 2013-01-19T17:39:13.363git remote -v
results:origin https://gist.github.com/4573850.git
Usinggit push origin
still brings up password prompt.Interesting, I was trying this on a gist that was already present therefore I removed my previous comment. It seems they have changed from git to https, it indeed doesn't work on https for me but I have no idea why. Does it list somewhere that https is supported through ssh-agent? – Tamara Wijsman – 2013-01-19T17:46:02.420
Not that I'm aware of but I'm hoping someone knows the answer. :) – wting – 2013-01-19T17:50:40.593
According to your own link it seems unsupported, I guess you could write a small function in .bashrc to rewrite the remotes in git style. – Tamara Wijsman – 2013-01-19T17:56:20.527
Yeah I'm actually doing that right now. T_T – wting – 2013-01-19T17:57:25.247