Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA GitHub integration creates the repository, but gets "couldn't authorize" error trying to push

  1. I create a new project in IntelliJ IDEA

  2. Via the menu, I go to VCS -> Import into Version Control -> Share project on GitHub

  3. Enter a new repository name and click Share

  4. It authenticates with GitHub ok

  5. When I try to push to GitHub, a login window opens that says "Login to https://github.com/[email protected]/GitHubTest2.git"

  6. 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 (i.e. [email protected]) and my GitHub.com password.

  7. 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?

like image 762
roark Avatar asked Dec 23 '12 05:12

roark


1 Answers

The following worked for me:

  • Instead of using username and password use a personal access token. In GitHub: Go to "Account settings" > "Applications" and generate a "Personal Access Token"

In IntelliJ:

  • Go to "Settings" > "Version control" > "GitHub" and enter your login and the generated access token. Now pushing to the GitHub repo should work.
like image 127
Philipp Avatar answered Oct 31 '22 21:10

Philipp