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/myemail@gmail.com/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. myemail@gmail.com) 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?

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.

Need Your Help

How to Map files to the Memory in Java nio?

java io mapping nio memory-mapped-files

I have a text file which I downloaded from the internet. File is large, somewhat around 77MB and I need to map it into the memory so I can read it fast. Here is my code

Port checking tool causes infinite packet received loop on TcpClient server

c# tcp mono network-programming tcpclient

I've written a relatively basic asynchronous server which boots up a task to accept clients and each client then boots up a task to accept incoming packets, the code for which is as follows: