Reputation: 373
Whenever I click push files to GitLab, first IDEA prompts me to enter login credentials.
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:
Cannot even add remote in IntelliJ:
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
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
Reputation: 373
The solution is to use https://git-scm.com/docs/git-credential-store. IntelliJ push now works after that.
Upvotes: 3
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