23

My repo: https://[email protected]/shadyabhi/learnajax.git

shadyabhi@archlinux-N210 ~/github/learnajax $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://[email protected]/shadyabhi/learnajax.git fetch = +refs/heads/*:refs/remotes/origin/* shadyabhi@archlinux-N210 ~/github/learnajax $ git config -l user.name=shadyabhi [email protected] merge.tool=vimdiff github.token=1095de7027bVVVV01cfAAAAAa5fc8f6 color.ui=auto core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.url=https://[email protected]/shadyabhi/learnajax.git remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* shadyabhi@archlinux-N210 ~/github/learnajax $ git push -u origin master Password: fatal: Authentication failed shadyabhi@archlinux-N210 ~/github/learnajax $ 

Now, I cant push into my repo. I have checked the github.token its the same as my Account Settings. Ofcoarse, I am entering the right password but I get this error.

2
  • Have you tried using SSH keys? Commented Mar 30, 2011 at 12:20
  • I have it blocked at my place. Commented Mar 30, 2011 at 12:21

7 Answers 7

74

I was having a similar issue pushing my origin with the correct user and password. It turned out that I had turned on 2-factor Authentication and had forgotten. If you have 2-factor Authentication enabled you will need to create an application specific password to push your repo. https://help.github.com/articles/creating-an-access-token-for-command-line-use

Sign up to request clarification or add additional context in comments.

4 Comments

That's the ticket. Apparently though once you enable 2-factor auth it no long allows key based auth (I guess that makes sense as it is only one factor)
Just in case it's not clear, the token that is generated here needs to be used in lieu of your password.
I got the access token, now what?
@Marian07: I know I'm late to respond but in case you didn't find the answer, you have to supply the personal access token in place of your password. For example, if, from the command line, you are doing "git push origin master", when you are asked to supply your password for GitHub, instead supply the personal access token that was generated.
10

There is some issue (if using https) if username contains "some" special characters.

4 Comments

Use mypass2011^@: as your password and you will know it that you wont be able to push
Did you contact GitHub about that? Seems like the bug is still there.
I recently changed my github account password to contain '.' and '!' characters and https authentication stopped working. This is dumb.
In my case in username was wrong. just first letter capital instead of small.
6

As I understand it, github.token (and github.user) aren't used by git HTTP transport - they're only there for other tools that use GitHub's API, such as GitX and GitNub.

I think the "Authentication failed" error must be due to you entering the wrong password. (This should be your GitHub password rather than the password to your SSH private key.)

2 Comments

I just discovered that if your pass is "mypass2011^@:", I cant git push using https. Sounds wierd, but can anyone confirm?
I had a similar problem; it didn't occur to me that using the SSH password wouldn't work for HTTPS (though, in hindsight, its absolutely obvious). Thanks for clarifying!
6

I have hit the same problem just now. Apparently, when you use git in command line, it wants you to enter the access token instead of password. This is really weird, but it works.

$ git push origin HEAD Username for 'https://github.com': <--- your username here Password for 'https://[email protected]': <--- access token here O_O 

PS: This is the instruction on creating token: https://help.github.com/articles/creating-an-access-token-for-command-line-use

Comments

2

I had just same problem as previously described. Passwords with #, ¤ or " didn't seem to work, whatever I tried.

Seems to be more or less similar problem as with Microsoft Office 365 portal, where you can't use ex. ¤ character in password, if you are going to use mobile devices as well.

Github login works fine with all passwords, in web... but using whatever client, it doesn't.

Comments

1

If your password contains special characters, git push won't work in Terminal. My workaround is open up emacs and do git push inside eshell.

2 Comments

Do you have idea why is that?
failed for me :( but thanks for letting me know eshell exists!
1

if your username or password has special characters, you can replace it with the encoded for example, if your password is "test@2010", you will write it as "test%402010" and the config command will be like this git config remote.origin.url https://{username}:test%[email protected]/{repo_username}/{repo_name}.git

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.