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.

link|improve this question
feedback

2 Answers

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

link|improve this answer
Thanks, but how do I specify my custom port (222) and where my private key is? – monoceres Dec 8 '11 at 16:38
These are probably the answers you need: stackoverflow.com/questions/7772190/… – Tim Dec 8 '11 at 16:41
feedback

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://git@mydomain.com:222/home/git/repo.git

or

ssh://git@mydomain.com: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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.