Git howto, in particular msysgit on Windows

Using msysgit over ssh on Windows with public/private key pairs

If you have SSH identity/Pubkey authentication access to a host that contains a git repository, you can configure git's ssh to automatically supply the identity keyfile for you. Edit the ssh config file (C:\Program Files\Git\etc\ssh\ssh_config for msysgit on Windows) and add a host entry:

Host remote-git-repo-host
Hostname gitrepo.example.com
User john
IdentityFile c:\mydocs\ssh_keys\remote-git-repo-host.private.OpenSSH

Note that the identity file (private) key must be in OpenSSH format; PuTTY keys don't work, but you can convert to OpenSSH them with puttygen. To test that you can ssh in, run

ssh remote-git-repo-host

If that succeeds, you should be able to clone the repo:

git clone remote-git-repo-host:repository

Note that there is no / after git clone remote-git-repo-host:.

My tags:
 
Popular tags: