184

I recently changed my Bitbucket password for security reasons. However, IntelliJ didn't update my repository to the new credentials, so it stops me from pulling/pushing anything to my repository. I am not using any plugins for this, just the integrated VCS operations inside the IDE.

Every time I pull/push, this pops out:

fatal: Authentication failed for 'https://momothereal:xxxxxxxxxxxx@bitbucket.org/team/repo.git/

Where xxxxxxxxxxxx is my old password. I think changing this remote address with the correct password would fix it, though I cannot find where to do so.

MozenRath
  • 9,652
  • 13
  • 61
  • 104
Momo
  • 3,542
  • 4
  • 21
  • 34
  • all see https://stackoverflow.com/questions/43543035/change-git-login-username-in-intellij-idea-rubymine-etc – Amit G Apr 18 '18 at 09:23
  • To solve "Auth fail" error see https://stackoverflow.com/a/56984900/746347 – mixel Jul 11 '19 at 08:34

29 Answers29

237

The easiest of all the above ways is to:

  1. Go to Settings>>Appearance & Behavior>>System Settings>>Passwords
  2. Change the setting to not store passwords at all
  3. Invalidate and restart IntelliJ
  4. Go to Settings>>Version Control>>Git>>SSH executable: Build-in
  5. Do a fetch/pull operation
  6. Enter the password when prompted
  7. Again go to Settings>>Appearance & Behavior>>System Settings>>Passwords
  8. This time select store passwords on disk(protected with master password)

Voila!

Note that this will not work if your password is in your URL itself. If that is the case then you need to follow the steps given by @moleksyuk here

You also choose to use the credentials helper option in IntelliJ to achieve similar functionality as suggested by Ramesh here

MozenRath
  • 9,652
  • 13
  • 61
  • 104
  • 2
    The menu has since been changed to Settings>>Appearance & Behavior>>Passwords. – MikaelF Jan 11 '18 at 23:22
  • 3
    Studio 3.1.4 Even with the option always OFF (don't store). It's still storing. So each time you miss the password you have to restart the Studio as it's consistently using that first password. – halxinate Sep 03 '18 at 06:56
  • 2
    A year later: For Windows 10 and multiple IDEA 2017+ builds, this doesn't work because the credentials are stored by Windows, not the KeePass file. See @Dush's [answer below](https://stackoverflow.com/a/50908824/1296767) for the fix. – mwoodman Feb 06 '19 at 16:01
  • 1
    I have started using the SSH way, so dont have to deal with this... :) – MozenRath Feb 07 '19 at 11:52
  • This solution did not work for me and may be out-of-date. The solution by Ramesh below worked for me. By deselecting "Use credential helper" I was able to performed a git operation like fetch where I was presented with a dialog to change my password. – Stephen Apr 16 '20 at 20:55
  • You are the best! Thank you! –  Dec 12 '20 at 19:14
  • Nothing works for me untill I changed the password from Windows credential manager – dragon66 Feb 07 '22 at 01:49
177

After trying several answers, I was finally able to solve this issue (on window 10),

>git fetch
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://gitlab.abc.net/V4/VH.git/'

By updating the password stored in Git Credential Manger for Windows(GCM),

Control Panel->User Accounts -> Windows Credentials
Dushmantha
  • 2,911
  • 1
  • 14
  • 21
  • 7
    Thanks! This finally worked for me. Why can't Intellij just prompt for the password on failure, like Eclipse does... – Pamasich Jan 08 '19 at 08:29
  • This solved my problem immediately. In my case it was under "Manage Windows Credentials" (Windows 10, Control Panel->User Accounts -> "Manage Windows Credentials") and then I changed the passwords for entries beginning with "git:". I even didn't have to restart anything. – krm Jul 04 '19 at 15:46
  • 1
    "Windows Credentials" is called "Anmeldeinformationsverwaltung" in German Windows. – moritz.vieli Sep 14 '21 at 06:45
38

There is an option to clear passwords

There is an option to clear passwords

borovsky
  • 873
  • 1
  • 9
  • 15
  • In the latest version of intellij we have an option set master password – vkrams Nov 12 '19 at 04:33
  • this worked for me, IJ on windows and recently my domain password has changed and I tried to execute a git command from the IJ terminal and got the 'fatal: Authentication failed for ...' error. After clearing the passwords this way from IJ settings, IJ prompted me for a fresh password. – consultantleon Aug 27 '20 at 13:54
33

Doing the following steps helped in my case:

1) open Settings 2) go to Git and Uncheck "Use credential helper" checkbox 3) Do git pull 4) Enter password in the pop up dialog

Git operations will now work fine in IntelliJenter image description here!

Ramesh
  • 681
  • 7
  • 15
  • haha Checking this Use credential helper, solved the problem of Goland hanging at `go list` and all other go cmds. :) So try it but beware! – seebi Dec 17 '20 at 15:03
  • This solution worked in those cases also where you add access token instead of ID and Pasword. Tested on 2021 versions of Intellij Idea and RubyMine. – Harsh Raj Apr 06 '21 at 21:08
15

Linux users (tested on ubuntu 14.04)

by default (on linux and mac) pycharm uses the OS's password manager. To access the passwords on ubuntu open the program "Passwords and Keys".

icon for password manager

Once open filter on "idea" and edit the relevant passwords.

pict of password editor dialog box

No need to restart pycharm for me.
Using pycharm 17.2

oneklc
  • 2,659
  • 1
  • 20
  • 13
13

This worked for me on Intellij 12:

Open settings -> passwords, select "Do not remember passwords" and apply/ok.

Do your VCS fetch/update/push/whatever and it should ask you for a password.

Check remember password and OK, it should do the VCS thing correctly.

Go back to settings -> passwords and switch it back to "Remember on disk", then apply/ok.

sy677
  • 131
  • 1
  • 6
  • Doesn't help. The setting is to Not remember passwords. – halxinate Dec 23 '18 at 17:33
  • @halxinate Yes, the "first step" was to select the setting to Not remember passwords. If you read all 4 of the steps you'll see it gets switched back at the end. Besides this advice was for version 12, which is now 7 years out of date. – sy677 Feb 20 '19 at 09:40
10
  1. Go to [project]/.git directory.
  2. Open for edit 'config' file.
  3. In '[remote "origin"]' section find 'url' property and replace your old password with new one.
  4. Press Ctrl+T in Intellij IDEA to update project.
moleksyuk
  • 413
  • 5
  • 10
  • 1
    I am not able to see pawword in 'url' property.Any other way? – BMM Nov 15 '17 at 10:23
  • it would be great if you could enter the proper steps to replace the password in the url. – MozenRath Jun 20 '18 at 05:21
  • 1
    credentials url should be like `https://username:password@www.github.com/myrepo.git` – Buddy Jan 08 '19 at 09:25
  • Can you please elaborate the steps. I cant see .git in my project directory. – Yasha Jul 01 '19 at 13:43
  • @Yasha '.git' folder is hidden by default. Enable "Show hidded files/folder" in your viewer tool. (It also depends on OS as well). – moleksyuk Feb 03 '20 at 11:39
  • Not password, it is your Personal Access Token that must be changed in url. credentials url should be like `https://username:your_personal_acces_token@github.com/username/myrepo.git` – mDonmez Oct 06 '22 at 18:36
5

In Intellinj IDEA 14, we can change the Git password by the following steps:

From the menu bar :

  1. Select File -> Settings -> Appearance & Behavior -> System Settings .

  2. Choose Passwords.

  3. Click the 'Master Password' under 'Disk storage protection'.

  4. In the Password field, enter your old password. Enter your new password in the subsequent fields.

  5. Now the master password will be changed.

Bhushan Gadekar
  • 13,485
  • 21
  • 82
  • 131
C. Natesh
  • 51
  • 1
  • 3
5

The following approach worked for me:

Create a new personal access token in GitHub and configure the connection in IntelliJ as per link: https://www.jetbrains.com/help/idea/github.html

Then, on IntelliJ, Settings-Version Control-Git screen, unclick the "Use credential helper" option.

IntelliJ Git Settings

Then do an restart with cache invalidation (File - Invalidate Caches / Restart - Invalidate and Restart)

Abhijith
  • 81
  • 1
  • 2
4

For Mac users this could also be helpful:

Credentials are stored in Keychain Access.app. You can just change them there.

w01ff
  • 41
  • 4
  • It is very clear approach to change the GIT password in Keychain app, without dealing with IDEA password management. – bel Oct 12 '17 at 09:08
4

For the record, if you've already configured Git on your terminal, there's an option in preferences to use native Git rather than the built-in (bundled) one.

Screenshot

galdin
  • 12,411
  • 7
  • 56
  • 71
  • This worked for me, but I had to change in the same screen the path to Git executable. – André Sep 13 '18 at 19:35
  • @André oh yes, looks like I din't mark it correctly. Since we don't want intellij to use the bundled git we'll have to tell it which one to use by specifying the path. For osx and linux it should be /usr/bin/git by default. – galdin Sep 14 '18 at 05:52
4

Go to VCS>Git>Remotes then remove your remote url from the list and add again. Git will ask for a password after next git operation (push, pull, etc). NOTE: Don't forget to specify username in url or you will get auth error.

3

The steps resolved issue for me in Windows

  1. Go to Control Panel

  2. Search for "Credentials"

  3. Select Windows Credentials

  4. Select github credentials from the list

  5. Select edit and update your password then restart Intellij

java.nazif
  • 713
  • 1
  • 9
  • 18
3

On Windows 10 go to:

Control Panel\User Accounts\Credential Manager

Under Generic Credentials find your repository URL, use Edit to change your password.

After these steps, a pull should work correctly.

enter image description here

ognjenkl
  • 1,407
  • 15
  • 11
1

For MACOS users

if you see credentials failed but you are sure that is is working previously then:

probably you made a software update to the system. System uses git bundled with xcode. its better to open Xcode and click install extra components on startup of xcode. it will say installing components. when you accept the license agreement if will start working again.

in short:

open Xcode, install additional components. accept user licence agreement.

on Xcode updates this step should be repeated.

Alp Altunel
  • 3,324
  • 1
  • 26
  • 27
1

You can change your password from settings screen (Ctrl + Alt + S by default) as attached screenshot. After clearing, on the firts remote operation (like pull/push, etc.) it'll ask you your credentials)

IMPORTANT: Take a copy of the file before this operation.

Settings Screen

Taner
  • 4,511
  • 3
  • 18
  • 14
1

In my case I have cloned a project from GitLab to develop it. I did couple of commits too. But suddenly I had to change the access token to download another project. After that I couldn't do anything related to git in CLION. So what moleksyuk has said is true.

close IDE > go to your local repo > go to .git directory (show if it is hidden already) > open the config file with a editor > In there,

[remote "origin"] url = https://{yourname:access_token}@gitlab.yourorganization.com/1stdir/2nddir/your_project.git

fetch = +refs/heads/:refs/remotes/origin/

You have to replace existing name and access token with the new ones.

looks like this(https://Janith:aBhsii6Usdjbsj@gitlab.yourorganization.com/1stdir/2nddir/your_project.git)

save > open IDE and do the git action.

1

Recently Bitbucket has stopped supporting user/pass git https integration. So I could no longer pull/fetch.

Turns out that it wasn't necessary to change the GIT Username or "authentication scheme"(from UserCredentials to Token).

All I had to is:

  • Please grab an app password (or generate on via Bitbucket Web UI), and use it to authenticate.
  • Use your Bitbucket username as a login, and app password as a password.

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003444939/comments/360000461679

razvang
  • 1,055
  • 11
  • 15
0

I needed to change my user name and password in Intellij Did it by

preferences -> version control -> GitHub

There you can change user name and password.

Idan Magled
  • 2,186
  • 1
  • 23
  • 33
0

For Mac User Please Go to As Below:

(First of all you must have installed bitbucket plugin)

Android Studio -> Preference -> Other Settings -> Bitbucket

Now change your password and click on Test for verify it. Will also able to add SSH Key for login.

Also its depend on which plugin you used. Some have direct like

Android Studio -> Preference -> Bitbucket linky

0

In my case, I got a CAPTCHA error. If you get that, first logout/login to Bitbucket, Github, .... on the website and enter the required captcha.

After that, try again from intellij and it should prompt for another password.

codepleb
  • 10,086
  • 14
  • 69
  • 111
0

This is how I solved it on Windows. I have git installed separately, and Idea just picks git's options automatically (Default Idea config, as I would get from clean installer).

Open the project in the command line. Make some changes there. And commit and push files via git which is installed on my machine. During push it will open a windows asking me to enter username and password. After that, when I make a commit-push from idea, it will simply work.

Yan Khonski
  • 12,225
  • 15
  • 76
  • 114
0

None of above worked for me. Using Android Studio 3.5 Beta 4. I even selected "do not save, forget passwords after restart" in file>settings>appearance & behavior>System settings>password

So What I did.

VCS>git>remotes

  • remove the repo and add again.
  • will ask for credentials.
  • then try git fetch in terminal.
  • Will prompt for password.
  • Issue fixed. :D
Akash Raghav
  • 1,073
  • 9
  • 19
0

git credential-manager clear Target Url: https://bitbucketxxxxxxxxxxxxxxxx.git

HongSec Park
  • 1,193
  • 8
  • 9
0

On Windows, just remove the remote repository (Git -> manage remotes ...) and add it again. you will be prompted to enter username and the new password.

mjassani
  • 129
  • 1
  • 2
0

Steps to change git remote username/password

  • Go to Control Panel
  • Search for Credential Manager
  • Click on Windows Credentials
  • In Generic Credential section ,there would be git url, update username and password
Ritu Gupta
  • 2,249
  • 1
  • 18
  • 11
0

I had to remove it from the git credential manager. After executing

git config --global --unset credential.helper

the password prompt came back @ IntelliJ 2022.2

0
  1. Close all instances of IntelliJ
  2. Start a new session of intelliJ
  3. Enter "git pull" command in intelliJ terminal and it prompts for userId/password.

Javeed.mca@gmail.com

M R Javeed
  • 89
  • 1
-2

IN Android Studio 2.3

  1. Open Setting (CTRL+ALT+S)
  2. Select Other Settings (at the end)
  3. select Bitbucket

Here you can change your new Password or User