Fixing github auth problem, cloning repository to Webstorm IDE

This probably works for other IDEs as well such as VS Code.
My context is Windows 10 and Webstorm version 2024.3.2.1

Problem: was connected to  my “work” github account and wanted also to be able to work with repos in my “private” github account.

Added the Github account in webstorm settings -> version control -> github -> (was logged in on github private account in web browser), got web browser authenticate question -> ok

Cloned a repo, got similar to the following git error message:

remote: Repository not found. fatal: repository 'https://github.com/MyUser/MyRepo.git/' not found

The repository exists at that location, its an auth problem.

Solution:

Tried to setup SSH but was a bit difficult, the “GitHub Desktop” application had no problem cloning and pushing though, but wanted it to work within Webstorm.

I tried the Github CLI application, download here: https://cli.github.com/

Open a terminal within Webstorm/at the project root and execute the gh command:

gh auth login

Follow the instructions regarding auth with web browser, (enter the one-time code at https://github.com/login/device).
Output from my terminal:

$ gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: ABCD-1234
Press Enter to open https://github.com/login/device in your browser...
✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as AndreasPlahn

Voila! Now it works for me, at least.

Update:
When pushing from Webstorm I get a dialog (on every push) which github acccount I want to be acting as.

This was annoying. Solved in this way:
(in cmd):

git credential-manager github list
-> see all logged in accounts

git credential-manager github logout <MyGithubAccountName>
-> logout one of the accounts to avoid

More info about git credential-manager in Windows:
https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/usage.md

Top 5 Tips for Angular Development With WebStorm | JetBrains

No matter how much familiarity you have with Angular, or how you feel about it, JetBrains IDEs can make your experience with this framework much better. In today’s FOMO digest, we’ll tell you about the features for working in Angular that you can find in JetBrains IDEs, such as WebStorm, IntelliJ IDEA Ultimate, PhpStorm, Rider, PyCharm Professional, GoLand, and RubyMine.

Source: FOMO Digest #2: Top 5 Tips for Angular Development With JetBrains IDEs | The WebStorm Blog

Angular component navigation doesn’t work anymore in Webstorm IDE

Please try invalidating caches (File | Invalidate caches, Invalidate and restart) – does the problem persist? Do you have @angular node_modules installed and included in project?

Also try reinstall npm packages:
npm install

Source: Angular component navigation doesn’t work anymore (webstorm) – IDEs Support (IntelliJ Platform) | JetBrains

Setup private SSH key for WebStorm and other IDEs in Windows

I had a problem pushing commits to Bitbucket inside Webstorm “no access” or similar error when trying to push.

I usually use Sourcetree together with Putty Pageant loaded with the putty specific SSH file format ppk. So the solution was to convert the private putty ppk file into OpenSSH file format using PuTTygen.

Then save that file into %userprofile%\.ssh\id_rsa
(id_rsa is the open ssh file name, no extension).
It made it possible for Webstorm to push to Bitbucket.

Follow these steps to convert from ppk to OpenSSH:

Another option is to convert the ppk format to an OpenSSH format using the PuTTygen program performing the following steps:
  1. Run the puTTygen program.
  2. Click Load.
  3. Select your private key that ends in .ppk and then click Open.
  4. Click the Conversions menu option.
  5. Click Export OpenSSH key.

Source: Change Private Key Format to Use with PuTTY

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000011270-How-to-set-up-git-SSH-keys-