2

I want to use the Git bash in windows in order to push-pull my project.
I have a ssh key that I use with putty.

With Git extensions my repository works well, I can do all operation as I want.
I've putty in my taskbar and my key is registered.

When I open the console and I try to push/pull git asks me for the password, but I've don't have one (the ssh key password does not work).

I've tried with git config -l and my remote url is git@server.ip.address/repository.git so I'm not using a http connection (I think).

How can I access to the remote through the console?

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Jepessen
  • 11,744
  • 14
  • 82
  • 149

1 Answers1

1

All you need to check from your git bash session in Windows is the environment variable HOME.

It must be set (usually to %USERPROFILE%) in order to include %HOME%\.ssh(\id_rsa/id_rsa.pub)

If %HOME% is properly set (type set HOME to check its value), ssh operations will work.

The presumes you are using openssh, not putty, which means you need to convert your ppk key into a public/private openssh set, to be copied in %HOME%\.ssh.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I don't have a .pub file. I've a .ppk key generated with putty. Inside my .ssh folder there's only `known_hosts`. I put my ppk key in another folder. – Jepessen Jan 04 '16 at 14:00
  • 1
    @Jepessen don't use putty: use openssh (http://stackoverflow.com/a/2224204/6309). But in any case, HOME must be defined. – VonC Jan 04 '16 at 14:14
  • Ok I'll try with openssh. I'll let you know. thanks. – Jepessen Jan 04 '16 at 14:16
  • @Jepessen maybe check first if this works, *before* accepting the answer ;) – VonC Jan 04 '16 at 14:17
  • I've checked to another site and with a colleague and they do the same way. I've faith... – Jepessen Jan 04 '16 at 14:36
  • It worked, thanks! The only thing that I had to do was to convert using `puttygen` my `.ppk` key to a openssh private key in order to put is into `.ssh` as you say. Can you add it to your answer for completeness? thanks. – Jepessen Jan 04 '16 at 15:13
  • 1
    @Jepessen Great! I have edited the answer as requested. – VonC Jan 04 '16 at 15:17