Recently, I started to work on new project which use some private repo in github installed with npm.
Those dependacies are using “git+ssh://git@github.com:
It seemed ssh authentication is necessary certainly. In Linux, just call key-gen and copy the content of public key and it works. However, in Windows, there is no keygen.
Click “Start” and find git bash, and run it, and then we can run
ssh-keygen -t rsa -C "your@email.com"
then it created the 2 files id_rsa and id_rsa.pub in currrent folder.
We should let the git know where to find the private key. It can be configued in /etc/ssh/ssh_config
But… in windows, where is /etc/ssh/? actually, I can’t find its physical path, so I can only use vim to edit it with
vi /etc/ssh/ssh_config
and add
Host *
IdentityFile /c/Users/<username>/.ssh/id_rsa
/c/Users/<username>/.ssh/id_rsa
is C:\Users\<username>\.ssh\id_rsa
then try to run
git ls-remote -h -t ssh://git@github.com/
then console prompt to ask to enter the password.
prompt to enter the password