Explain Codes LogoExplain Codes Logo

Change remote repository credentials (authentication) on IntelliJ IDEA 14

java
credential-management
intellij-idea
git-credentials
Alex KataevbyAlex Kataev·Feb 1, 2025
TLDR

To refresh your IntelliJ remote repo credentials swiftly:

  1. Navigate to File > Settings > Appearance & Behavior > System Settings > Passwords.
  2. Choose Do not save, forget passwords after restart to wipe old credentials.
  3. Restart IntelliJ. It asks for new credentials on connecting to the repo again.

For Git repositories, use the terminal:

# Using new creds faster than you can say 'git push' git remote set-url origin https://<new_username>:<new_password>@<repository_url>

Replace <new_username>, <new_password>, and <repository_url> with your new details. Use Git's credential helpers for a peace of mind.

Safeguarding your credentials

Here, we dive into how to ensure your repository connection remains secure. We'll also discuss managing passwords and tweaking SSH settings in IntelliJ IDEA.

Level up your password safety

Avoid storing passwords insecurely:

  • Go to File > Settings > Appearance & Behavior > System Settings > Passwords.
  • Choose Do not save, forget passwords after restart or Save passwords on disk (ensured with master password).

Updating your SSH arsenal

Boost your security with SSH:

  1. Head to File > Settings > Version Control > Git.
  2. From the SSH executable dropdown, select Built-in.

Call in your credential helpers

Safely store your credentials using Git's credential helpers:

  • Enable by typing git config --global credential.helper store in the terminal.
  • Make sure your password isn't stored in the URL. If it is, remove and reset the remote as shown in the fast answer section.

Credential check at every fetch/pull

Never be caught off guard. If you chose not to store passwords, get into the habit of entering your password manually during fetch/pull operations.

Match your password patriots

For certain operating systems, the in-built password managers need to be up-to-date:

  • On Windows, go to Control Panel > User Accounts > Credential Manager.
  • For Ubuntu, seek Passwords and Keys.

Troubleshooting and best practices

In this part, we'll spotily cover potential issues you might encounter and how to keep best practices at your fingertips.

Dealing with Bitbucket and alike

Ensure you have a smooth sail with remote services like Bitbucket:

  • Make sure your remote address and updated credentials in Bitbucket match.
  • To test, try a fetch or pull operation using IntelliJ IDEA.

Update credentials in Git Credential Manager

On a Windows machine, you may need to update credentials in the Git Credential Manager (GCM) after you change your password.

If things get rocky, uncheck

In some cases, you could face issues post updating your credentials. In such a scenario, revisit your Git settings and consider unchecking Use credential helper.

Leveraging IntelliJ updates

Upgrading your IntelliJ IDEA might be a good idea as it generally offers improved VCS credential management. Plus, who doesn't like freshness!

The "Authentication failed" bump

In the unfortunate event that you face a fatal: Authentication failed error, you can generally fix this by clearing stored credentials in IntelliJ IDEA's settings.