Daryll David Dagondon
Daryll David Dagondon

Reputation: 373

IntelliJ GitLab. Push failed. Failed with error: Authentication failed

Whenever I click push files to GitLab, first IDEA prompts me to enter login credentials.

enter image description here

This dialog window always pop up 3 times after clicking OK. login and password are correct. And after that I always get this error message:

enter image description here

Cannot even add remote in IntelliJ:

enter image description here

But I can "git add" and commit changes in IntelliJ.

Edit: The solution is to use https://git-scm.com/docs/git-credential-store. IntelliJ push now works after that.

Upvotes: 3

Views: 12768

Answers (3)

VonC
VonC

Reputation: 1325047

One possibility is that your password include a special character that must be percent encoded.

Another is that you have the wrong credentials cached in the Windows Credential Manager.

Regarding the remote, and its error message:

 Remote URL test failed: Authentication failed.

You can see in JetBrains/intellij-community/blob/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java that it does a git ls-remote

So double-check first what a git ls-remote https://... returns: it should pick your credentials in the credential helper.


As mentioned above, a credential manager issue was the cause.

git config credential.helper

IntelliJ should use the IntelliJ Platform Credentials Store API.

Upvotes: 4

Daryll David Dagondon
Daryll David Dagondon

Reputation: 373

The solution is to use https://git-scm.com/docs/git-credential-store. IntelliJ push now works after that.

Upvotes: 3

Dmitrii Smirnov
Dmitrii Smirnov

Reputation: 7538

Git add and git commit are local operations, they need no password. A password is required for operations with remotes only - push, pull, ls-remote.

Does it work if you try pushing from the command line?

Also, it is worth checking the logs to find the exact error reason, This could be not only a wrong password but some other underlying error.

Upvotes: 3

Related Questions