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-

How to set aliases in Git Bash for Windows?

For windows 10:
Open folder “C:\Program Files\Git\etc\profile.d”
Edit file “aliases.sh” using Notepad++ or other text editor in Administrator mode.
Add another alias line beneath the present alias lines:
alias ls=’ls -F –color=auto –show-control-chars’
alias ll=’ls -l’
alias ngs=’ng serve –open’

Above is an alias ngs for serving angular development server and open a web browser.
Instead of typing “ng serve –open” in Git bash window you should now be able to just use ngs as an shortcut alias.

Bitbucket Set up an SSH key on Sourcetree for Windows – Atlassian Documentation

Goto heading “Set up SSH with Sourcetree on Windows”‘
Source: Set up an SSH key – Atlassian Documentation


Also see this fix for getting PuTTY Pageant working with Visual Studio 2017 built-in GIT:
I finally managed to make it work, using PuTTY’s Pageant authentication agent instead of ssh-agent, and following the steps mentioned here (it’s for Visual Studio Code, but works for Visual Studio 2017 and I guess it should work for any application that uses the “official” Git for Windows).

Since I already had Pageant installed and a .ppk private key created, I only had to make Git use Pageant, by creating the GIT_SSH Windows environment variable and setting it to the path of the “plink.exe” file (inside the PuTTY installation, for example C:\Program Files (x86)\PuTTY\plink.exe). With that done, I just need to open Pageant and add the private key (and leave it open while working with the repository), and Visual Studio will be able to connect and issue commands just fine.
Fromhttps://stackoverflow.com/questions/42773636/connect-to-git-repository-with-ssh-using-visual-studio-2017#

‘fatal: unable to access ‘\/.config/git/config’: Invalid argument’ when running VS 2017 and opening a GIT based solution

I got this message ‘fatal: unable to access ‘\/.config/git/config’: Invalid argument’ when opening a GIT based solution in VS 2017.
Solution was to add an environment variable “HOME” with value “c:\” (c: or where your project folder resides).

Solution info here:

Source: I get ‘fatal: unable to access ‘\/.config/git/config’: Invalid argument’ when running VS 2017 as a user on a different domain from local windows user – Developer Community

GIT – How to ignore local changed file

If you have a config file or something similar you change on your local computer but dont want it to get marked as “modified”.

Use this command:

If remote repo gets an update on that file you will get notified about this on a pull.

From stackoverflow:
skip-worktree is useful when you instruct git not to touch a specific file ever. That is useful for an already tracked config file.
Upstream main repository hosts some production-ready config but you would like to change some settings in the config to be able to do some local testing. And you don’t want to accidentally check the changes in such file to affect the production config. In that case skip-worktree makes perfect scene.

If you have skip-worktree on a file and the upstream changes, you get “please commit or stash” when you try to pull

More info here:
http://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree/13631525

 

SourceTree very slow when switching repository tabs

My SourceTree GIT manager was freezing for 5-10 seconds when switching between repositories.

These commands fixed the issue:

Also in combination with adding GIT program folder and SourceTree program folder to excluded paths for Windows Defender (antivirus scanner). The switch between tabs is now instant.

Source: SourceTree very slow with many repositories