I create a new project in IntelliJ IDEA
Via the menu, I go to VCS -> Import into Version Control -> Share project on GitHub
Enter a new repository name and click Share
It authenticates with GitHub ok
When I try to push to GitHub, a login window opens that says "Login to https://github.com/myemail@gmail.com/GitHubTest2.git "
The default login is github.com/my_username. I try to login with that login and my GitHub.com password and authentication fails. I also try to login with my GitHub.com login (ie myemail@gmail.com) and my GitHub.com password.
After 3 tries, I get the following error message:
Push to GitHub failed Push authorization failure: Couldn't authorize
Why does it authenticate with GitHub with my GitHub.com login/password but not when it tries to push the project to GitHub?
The following worked for me:
In IntelliJ:
Try to use ssh instead of https ( with the generated keypair: https://help.github.com/articles/generating-ssh-keys ).
This may solve the issue for you, for me it just changed the error message I was seeing in IntelliJ from GitHub to "remote host hung up unexpectedly."
I then tried pushing to GitHub from terminal and it worked. From terminal, it works regardless of whether I use SSH or https. I therefore suggest using command line git for pushing code to GitHub instead of the IntelliJ integration.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.