H
H
hjk2014-09-12 13:11:28
git
hjk, 2014-09-12 13:11:28

How to set up ssh for git?

The installation order was:
- msysgit
- Putty (installer)
- TortoiseGit
After installing and basic setting up the global git config, I created a key pair using puttygen. I saved the keys to a folder (conditionally D:/ssh-putty). Using the TortoiseGit GUI, I quietly cloned the repository from Gitgub, made a couple of commits, and pushed back. All communication took place through the ssh keys created the day before.
Theoretically, it is already quite possible to work, but I wanted to set up work through PHPStorm. As I found out, it uses git.exe, and here lies the problem - how can git.exe slip the keys that I created in Putty?
Article Making Git Friends with PuttyI read and added the GIT_SSH environment variable - it didn't work. Neither PHPStorm nor Git Bash can do
git push -u origin master
what you guys advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Volintsev, 2014-09-13
@hjk

Git for Windows:
project page git-scm.com
distribution selection page git-scm.com/download/win

mkdir -p /c/project/.ssh
ssh-keygen -f /c/project/.ssh/id_rsa -C any_comment

This will generate a pair of keys, and the public one will need to be specified in github to access your repository
. Public reads like this:
Further, in order for the key to be picked up by all applications that use ssh, you need to specify it in the configuration file, which is stored in the .ssh folder of the home directory
touch ~/.ssh/config
notepad ~/.ssh/config
You need to add lines like this
Host github.com
HostName github.com
Port 22
IdentityFile /c/project/.ssh/id_rsa

Next, you need to clone your repository using SSH : take.ms/h3QCp get link example
Basically no magic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question