4

I'm new to github and I couldn't seem to find a solution to my problem, so bear with me a little.

I'm trying to push changes that I've made to a forked repo via command line on an ec2 ubuntu instance from aws. After making changes to my file, I committed the file I changed and then pushed it over to git:

ubuntu@ip-172-31-33-24:~/bitstarter$ git push origin master
Username for 'https://www.github.com': edasaur
Password for 'https://edasaur@www.github.com':
fatal: Authentication failed

I'm hypothesizing that this might be an issue with the fact that I'm pushing over to a forked repo because when I attempted to commit and push changes over to a repository that I started, it seemed to work. However, I'm at a loss at what to do. When I tested whether my SSH key worked via the command:

ubuntu@ip-172-31-33-24:~/bitstarter$ ssh -T git@github.com
Hi edasaur! You've successfully authenticated, but GitHub does not provide shell access.

Thanks in advance!

Edasaur
  • 397
  • 1
  • 8
  • 19
  • It should work even with forked repos. Are you sure the credentials are correct? What happens if use the SSH key instead and change the remote to the ssh URL? – nif Jul 13 '13 at 18:38

1 Answers1

4

First, you are pushing using an https address, so any ssh settings you might have won't have any bearing on the completion of the (https) push.

Second, the right https url you should use is:

https://edasaur@github.com/edasaur/bitstarter.git

(no need for www.github.com)
(I like to put the username in the url: that is one less data to enter when pushing)

That means you can set your url with:

git remote set-url origin https://edasaur@github.com/edasaur/bitstarter.git

Third, double-check your password (and see if there is any special character in it like an '@', which might not be directly supported over an http query)

If nothing works, you can still fallback on ssh url:

git remote set-url origin git@github.com:edasaur/bitstarter.git
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It worked! Wow thanks a lot! :D Any ideas why http query doesn't support '@'? – Edasaur Jul 13 '13 at 22:00
  • @Edasaur it does support '`@`', but you need to [url encode it](http://stackoverflow.com/a/3608791/6309): `%40` for an '`@`'. See http://stackoverflow.com/a/17106141/6309 or http://stackoverflow.com/a/10050890/6309 – VonC Jul 13 '13 at 22:34