You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to push I get prompted for username/password then get "Authentication failed on the git remote."
I am able to push from GitHub for Windows and command line using same credentials
Reacted by Vinny, Rasmus Slot, Sergey Kaptur, Rodrigo Olivares, Jan Hohenheim, Alexander Bykhov, Oleg Shatin, Cody Swartz, Rakka Rage, Petr Švihlík and 1 more
GitHub Desktop clones every repository using the https protocol and creates ~/.ssh/github_rsa and ~/.ssh/github_rsa.pub which it somehow uses for auth. git (or ssh) by default only looks for ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub when using authentication.
We need to:
Find out how GitHub Desktop is able to use pubkey auth with the https protocol
Make VSCode use that github_rsa key when pulling/pushing from a GitHub repository.
Reacted by Alessandro Pezzè, Shahriar, Burhan Del Rey, Sergey Kaptur, Alexander Bykhov, F David and daopig
I can confirm I am having this same issue. I can use GitHub Desktop or CLI to push, but I can not sync with VS Code. I tried again with the December update and it was not supported still.
I found the following Stackoverflow post that solved this issue.
Basically, I ran git config --global credential.helper wincred from the command line, and restarted VC Code. When I reopened the project, I was now able to sync from VS Code.
Do not know how this persists, and if it is only for that repo (--global makes me thing it will work elsewhere).
Can we run this command as part of installation, if this solves the issue?
Reacted by Misael Villaverde, Sergey Kaptur and Diego Menin
Hello, I'm having the same issues, already followed the Stackoverflow post but it didn't work.
I don't have any problem with editing the code in VSC and then using the CLI or the GitHub desktop to sync my repos but It would be great if this issue is solved, the last update didn't solved it.
this "git config --global credential.helper wincred" might work on windows, but I'm using a mac and Microsoft forces anyone on their repositories to activate 2 factor authentication.
I cannot login from VSCode to my GitHub in order to sync with origin.
Does anyone have a workaround for a Mac?
Reacted by Cody Swartz, Isaac Abotsi, Dariusz Filipiak and n0vat0r
FYI found a workaround that seems to work on all OS systems, Mac and Windows:
Visit your github developer settings and generate a personal access token.
That token can be used as your password with your user name to login from VSCode and it seems to work normally from that point on without any special configuration.
Reacted by Cody Swartz, Lewis Bowman, Petr Švihlík, Suvan Leelasena, antonmorya, NWilkieTechno, Tom Dickson, Pedro Albuquerque and Ivan Rojkov
It still doesn't work for me, I managed to login via the terminal, but using your username + password = token didn't workout very well with 2FA enabled
I noticed that even though there is a pop-up GUI window that takes the Git username and password, there is another Visual Code pop-up, under the top main menu bar in Visual Code, that asks for the Git username and password. After you enter your credentials there too, it works.
I came across to this problem too just now after enabling 2FA on my account. I've regenerated the access token for VSC, and used it as the password. I was prompted twice but it worked. (OS: Windows 10)
FYI found a workaround that seems to work on all OS systems, Mac and Windows:
Visit your github developer settings and generate a personal access token.
That token can be used as your password with your user name to login from VSCode and it seems to work normally from that point on without any special configuration.
Code now supports automatic GitHub authentication, when using HTTPS repositories, so there's no need to support GH Desktop. This is already working in Insiders and will come out soon in the next stable.
Activity
joaomoreno commentedon Nov 23, 2015
What do you get when running
git remote -v?joe912 commentedon Nov 23, 2015
Hi, opening GIT bash in the folder & running I get
$ git remote -v
origin https://github.com/joe912/taggle.git (fetch)
origin https://github.com/joe912/taggle.git (push)
joaomoreno commentedon Nov 24, 2015
Yeah this is known. Hope you don't mind that I renamed this issue.
[-]Authentication failed on the git remote.[/-][+]Support GitHub for Windows authentication[/+][-]Support GitHub for Windows authentication[/-][+]Support GitHub Desktop authentication[/+]joaomoreno commentedon Nov 24, 2015
GitHub Desktop clones every repository using the
httpsprotocol and creates~/.ssh/github_rsaand~/.ssh/github_rsa.pubwhich it somehow uses for auth.git(orssh) by default only looks for~/.ssh/id_rsaand~/.ssh/id_rsa.pubwhen using authentication.We need to:
httpsprotocolgithub_rsakey when pulling/pushing from a GitHub repository.joe912 commentedon Nov 24, 2015
ok - thanks for the update
khrome83 commentedon Dec 20, 2015
I can confirm I am having this same issue. I can use GitHub Desktop or CLI to push, but I can not sync with VS Code. I tried again with the December update and it was not supported still.
khrome83 commentedon Dec 20, 2015
I found the following Stackoverflow post that solved this issue.
Basically, I ran
git config --global credential.helper wincredfrom the command line, and restarted VC Code. When I reopened the project, I was now able to sync from VS Code.Do not know how this persists, and if it is only for that repo (
--globalmakes me thing it will work elsewhere).Can we run this command as part of installation, if this solves the issue?
mgs96 commentedon Dec 24, 2015
Hello, I'm having the same issues, already followed the Stackoverflow post but it didn't work.
I don't have any problem with editing the code in VSC and then using the CLI or the GitHub desktop to sync my repos but It would be great if this issue is solved, the last update didn't solved it.
thanks
10 remaining items
shaipetel commentedon Mar 29, 2018
this "git config --global credential.helper wincred" might work on windows, but I'm using a mac and Microsoft forces anyone on their repositories to activate 2 factor authentication.
I cannot login from VSCode to my GitHub in order to sync with origin.
Does anyone have a workaround for a Mac?
shaipetel commentedon Mar 29, 2018
Since I don't want to Hijack this thread for Mac, I opened a separate issue for Mac OS:
#46964
shaipetel commentedon Apr 9, 2018
FYI found a workaround that seems to work on all OS systems, Mac and Windows:
Visit your github developer settings and generate a personal access token.
That token can be used as your password with your user name to login from VSCode and it seems to work normally from that point on without any special configuration.
benjaminmoules commentedon Jun 11, 2018
It still doesn't work for me, I managed to login via the terminal, but using your username + password = token didn't workout very well with 2FA enabled
kanmalkal commentedon Jul 15, 2018
I noticed that even though there is a pop-up GUI window that takes the Git username and password, there is another Visual Code pop-up, under the top main menu bar in Visual Code, that asks for the Git username and password. After you enter your credentials there too, it works.
Peakdrum commentedon Sep 13, 2018
in case if you set up 2 stage auth you can use this https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
gazmull commentedon Mar 15, 2019
I came across to this problem too just now after enabling 2FA on my account. I've regenerated the access token for VSC, and used it as the password. I was prompted twice but it worked. (OS: Windows 10)
Pedroalbuquerque commentedon May 3, 2020
Work for me too, great job !
joaomoreno commentedon May 6, 2020
Code now supports automatic GitHub authentication, when using HTTPS repositories, so there's no need to support GH Desktop. This is already working in Insiders and will come out soon in the next stable.
https://twitter.com/joaomoreno/status/1255852214997995522