Pycharm GitHub 'Push failed: fatal: Authentication failed'

前端 未结 7 1604
臣服心动
臣服心动 2021-01-04 23:19

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 repo         


        
相关标签:
7条回答
  • 2021-01-04 23:51

    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.

    0 讨论(0)
  • 2021-01-04 23:53

    If your username or password has special characters, you can replace it with the Percent-encoding for theses characters. 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%402010@github.com/{repo_username}/{repo_name}.git

    0 讨论(0)
  • 2021-01-04 23:59

    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.

    0 讨论(0)
  • 2021-01-05 00:00

    Ok guys, I tried all suggested solutions and they did not worked for me.

    I use git bash and bitbucket.

    Finally I turned it upsidedown, and it worked - at least that way. I know this is difficult and foolish solution, but it worked. So the steps:

    1. you have your code on your local machine.

    2. you have your repo /on bitbucket/

    3. Delete your repo or make a new one with new name

    4. Make a readme.md with the help of the /bitbucket's/ dashbord

    5. clone the new repo

    6. copy your files into this new folder which you want to push

    7. do the git bash work (add,commit) and push it to the repo.

    0 讨论(0)
  • 2021-01-05 00:01

    So I found the solution to my problem, and I hope this helps:

    If you are using KDE, or Gnome, your "KDE Wallet", or "Gnome Keyring" manager will save your password when you push for the first time. However, if you enter the password wrong, these managers (ksshaskpass for KDE) will store the wrong password and will send the wrong password every time.

    To fix this, open the appropriate manager and change the password. With KDE, it is in: Kick-off-menu > System Settings > Account Details > KDE Wallet, then click "Launch Wallet Manager", and find "ksshaskpass", expand it, and then expand "Passwords", then find your github registered email address there, click it, and on the right, click on "Show Contents". Now change that value (in case wrong password), then hit save. and you're done!

    Now that means you don't have to type in your password each time for https push, and you don't have to use SSH keys either ;)

    0 讨论(0)
  • 2021-01-05 00:11

    I came across this once. Turned out that the Web Credentials in the Credentials Manager stored an incorrect password for github.com and gitlab.com.

    I removed that and it gave me the option to log in when I added a new repository.

    0 讨论(0)
提交回复
热议问题