Git Windows setup - AuniTech/DevTips GitHub Wiki

Git Windows setup

Download

  • Putty to connect to the server and run git commands via terminal
  • Puttygen to generate a ssh keypair for secure connections
  • SFTP NetDrive to mount your remote server www folder locally.

Step 1. Generate a SSH keypair to connect to Github

Begin with downloading Puttygen, this is a executable wit which you can generate SSH keypairs for windows.

  1. Open the executable
  2. Press Generate (you can leave the password field blank for passwordless login)
  3. Move your mouse around
  4. Press save public key, name the file id_rsa.pub and place it somewhere "safe"
  5. Press save private key, name the file id_rsa.ppk and place it together with the public key
  6. You should also create an OpenSSH key so it can be used with linux, you do this by Clicking Conversions -> Export OpenSSH key

Step 2. Copy your SSH public key from server to your computer

This can be done in various ways, if you've used Putty and the terminal before, rock on. If not you should probably ask Oskar or Christoffer for help. @todo write guide

Essentially what you do is:

  1. Connect to server with putty
  2. Generate the key with ssh-keygen if you haven't already.
  3. Write cat ~/.ssh/id_rsa.pub/ and copy the string to a file on your local computer.

Step 3. Mount remote folder with SFTP NetDrive

  1. Download SFTP NetDrive, install and launch it.
  2. Enter the server's address as the host name.
  3. Assign a drive letter
  4. For login use the public key you retrieved in Step #1.
  5. Under Server Settings choose /var/www/u/USERNAME as Disk Root Folder
  6. Under Server Settings choose UTF-8 as the SFTP Protocol charset
  7. Connect!

Step 4. Use git!

Command line

One option is to develop the site with your own favorite editor in the newly mounted drive, and then use putty to run the git commands. Read the git commands page to learn more about this.

TortoiseGit

  1. Download TortoiseGit and install it. We need information about what settings to use during installation

Github App

  1. Download Github for Windows and install it.
  2. Set Default Storage directory to your new drive
  3. Set default shell to either Git Bash or PowerShell (Vista/win7)
  4. Upload your id_rsa.pub to github and set the id_rsa as your key in the app.

Step 5. Configure Putty!

A rule for all applications in this matter, if see an option to set encoding, always change it to UTF-8, this will save everyone a lot of headache.

Other stuff:

  • Terminal -> Bell Set to none, this is really annoying
  • Connection -> SSH -> Auth Set to the public key you copied earlier
  • Window Set Lines of scrollback to 2000 so you can scroll and see some history
  • Window -> Translation Set Remote Charset to UTF-8!
  • Session Type in session name under Saves Sessions and press save so you can load it later