Using Git and Github on Windows
Github is all the rage for source control / hosting OpenSource projects right now - which is a great thing, because for end-users who just want to grab a .zip file of the code or report an issue, it's really easy to use. If you want to check your code in to Git though, and you're on Windows, it can be hard to know where to start. I just went through the process of setting it up, so I thought others might find this useful. Here's the steps I took:
- Download and install "msysgit" from http://code.google.com/p/msysgit/ (from "featured downloads" on the right of the screen). This provides the core command-line Git functionality.
- To make life easier, download and install Tortoise Git from http://code.google.com/p/tortoisegit/ which is just like Tortoise SVN, which I use for SVN, and works great. It's completely visual and feels like native part of Windows.
- Download and install Putty and PuttyGen (I selected the installer for the full suite because I'm not sure exactly which things you might need) - you'll need this to generate an SSH key. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Create an account on GitHub - https://github.com/
- Create a repository on GitHub.
- In "Account Settings" on GitHub, click on "SSH Public Keys" and add a new key. The title should be your email address. To generate the key itself, use PuttyGen, which you downloaded earlier, and copy-paste it in.
- Right click in the folder which you want to check-in to Git. Select Git Create repository here. Create it.
- Right click in the folder again. From the right-click menu, select Tortoise Git - Settings.
- Make sure Tortoise Git has found MSysGit.
- In Git - Config, add your name and email address - this should match your GitHub settings.
- In Git - Remote, select Add New. Add the private key from Putty that you generated earlier. The private key is a file rather than something you copy-paste. Get the URL and name from the "Source" or "Admin" tabs of your repo on the github website.
- Select all the files you want to check-in, right-click and select Tortoise Git - Add...
- Right click again and select Tortoise Git - Commit -> Master.
- Hopefully it should all upload and you're done!
Don't ask me any difficult questions, because I'm surprised I got this working myself, but good luck! I'm liking Git so far.