Cannot push to github repo

Abhijeet Rastogi picture Abhijeet Rastogi · Mar 30, 2011 · Viewed 41.2k times · Source

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.

Answer

Kelley Kavanaugh picture Kelley Kavanaugh · Sep 25, 2013

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