Git insists on asking me for my user name



This worked okay:
rhedin:~/workspace (master) eval (ssh-agent -s)
Agent pid 47088

And this worked okay:
rhedin:~/workspace (master) $ ssh-add ~/.ssh/id_rsa
Identity added: /home/ubuntu/.ssh/id_rsa (/home/ubuntu/.ssh/id_rsa)

But still:
rhedin:~/workspace (master) $ git push origin master
Username for ‘’: ^C

My ~/.ssh/config file looks like this:
rhedin:~/workspace (master) $ cat ~/.ssh/config
HashKnownHosts no

User git
Port 22
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
UserKnownHostsFile /dev/null
StrictHostKeyChecking no

IdentitiesOnly yes
UserKnownHostsFile /dev/null
StrictHostKeyChecking norhedin:~/workspace (master) $

Do you know why it insists on asking me for my username and password?


If you run git remote -v, you’ll probably see something like this:

origin (fetch)
origin (push)

The problem here is that because your remotes use HTTP(S) rather than SSH, it’s completely ignoring all of your SSH settings. To fix this, go to your GitHub repository, click on Clone or Download, click the Use SSH link at the top right of the popup, and copy the link that should be in the format, Then, in the Cloud9 terminal, run git remote set-url origin <paste URL here>, and when you run git remote -v, you should see something like the following:

origin (fetch)
origin (push)

Now, try pushing with the normal git push origin master. This time, your SSH settings should be respected, and it shouldn’t ask you for your username.


You’re right. That’s it!

I haven’t tried it yet, but I’m sure that’s it. Bless you.


Yup. It worked! Thanks.