1

I'm trying to use Git for the first time (I have used Mercurial before so I know the basic setup).

Everything is ready on the server side with the following properties:

  • User name: git
  • Domain: mydomain.com
  • Port: 222
  • Repo path: /home/git/repo.git
  • Public key saved in: /home/git/.ssh/authorized_key
  • Private key saved on my local Windows machine.
  • The key pair was generated with PuTTYgen

During installation of Git on my Windows machine I chose OpenSSH if that matters.

So my question is, how do I check out my repo?

Thanks.

2
  • PuTTYgen generates the key in different format than OpenSSH expects. Do you have it in openssh format in %USERPROFILE%\.ssh\id_rsa and %USERPROFILE%\.ssh\id_rsa.pub as OpenSSH expects?
    – Jan Hudec
    Commented Feb 5, 2014 at 12:39
  • Note that Git Gui has a menu for generating/showing the ssh key. That's the easiest way to generate it so that it is properly set up for git.
    – Jan Hudec
    Commented Feb 5, 2014 at 12:40

2 Answers 2

1

git clone username@server:/path/to/git/repo.git while you are in the folder where you want to check out to.

2
0

Use [user@]host:relpath to clone over SSH, or ssh://[user@]host[:port]/abspath if you need to specify a different port.

For your current configuration:

ssh://[email protected]:222/home/git/repo.git

or

ssh://[email protected]:222/~/repo.git

With OpenSSH, you need to export your private key to OpenSSH format (using PuTTYgen), then either a) save it as ~/.ssh/id_rsa or ~/.ssh/id_dsa depending on the type, or b) save it anywhere you like, then edit ~/.ssh/config IdentityFile to point to the file. (a is better if you use the same key to connect everywhere; b is better if you use different keys for different servers.)

On Windows, the location is %USERPROFILE%\.ssh, and you'll probably need to create the .ssh directory yourself using Command Prompt.

If you had chosen PuTTY/plink, you could double-click the .ppk key file to load it to Pageant, and it would be used automatically.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .