Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm GitHub 'Push failed: fatal: Authentication failed'

Every time I try to push a repository in GitHub with Pycharm the it fails.

Push failed: fatal: Authentication failed for 'https://github.com/(my github repository)/'

In Settings->Version Control->GitHub, I filled the fields Host, Loging and Password (Auth Type: Password). Testing it: "Connection successful"

In Settings->Version Control->Git, Path to Git executable is seted with the full path, SSH executable: Buil-in

Pycharm version 3.1.1 Git version 1.8.4.msysgit.0 On Win 7.

like image 321
Trimax Avatar asked Mar 12 '14 10:03

Trimax


People also ask

How do I fix Git fatal authentication failed?

It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it. Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.

How do I push a PyCharm code to GitHub?

Do one of the following: To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.

How do I enable GitHub in PyCharm?

Create a new GitHub accountPress Ctrl+Alt+S to open the IDE settings and select Version Control | GitHub. Select Log In via GitHub. In the browser window that opens, click Create an account and complete the registration process on GitHub. Return to the PyCharm settings, click Cancel, and then repeat steps 2 and 3.


3 Answers

I struggled with this problem for half a day using Git in PyCharm.

Solution: Settings => Version Control => Git => ticked "Use credential helper" and then it worked perfect.

like image 86
Petter Ivarsson Avatar answered Oct 17 '22 10:10

Petter Ivarsson


I tried all but it worked me charm : The problem I had : Every thing was working from terminal and from Github desktop as well. But when I tried to PUSH/PULL from pycharm it wasn't working. Reason : It happens because by-default pycharm save password locally in DB.

Work around: Go to File > Settings > Appearance & Behavior > System Settings> Passwords, clicked on 'Do not save..", restarted IntelliJ and VCS asked for password again.

like image 24
Amol Kumar Avatar answered Oct 17 '22 09:10

Amol Kumar


It seems there is some issue (if using https) if username or password contains "some" special characters.

So, I've generated a secondary password ("personal access token") in GitHub's application settings page (using the "Create new token" button), I did copy this token. Then I've selected Auth Type: Token in Settings->Version Control->GitHub, and pasted the token.

Testing it: Connection successful for user . Now the git push works perfectly.

like image 40
Trimax Avatar answered Oct 17 '22 08:10

Trimax