Going Git
The very first thing to get started with on my Texas Hold'em kata is getting up and running with GitHub. The prerequisites involve getting Git installed. I'm on Windows7, which involved the following:
- Download msysgit from googlecode: http://code.google.com/p/msysgit/downloads/list. At the time of writing, the netinstall version was called msysGit-netinstall-1.7.0.2-preview20100407-2.exe.
- This will take a little while to do it's thing while it downloads all the necessary bits and bytes.
- Create a public key (the instructions are fully explained on the GitHub site):
- In the msysgit install directory, run msys.bat to launch the git console.
- Run
ssh-keygen -t rsa -C "<your email>" - Press return at the first prompt to accept the default key location.
- Enter a good passphrase that you will remember!
- Sign up for a free GitHub account.
- In the SSH Public Key field, enter the contents of the public key file (C:\Users\<User>\.ssh\id_rsa.pub).
- That's it. To test it out, in the git console, type
ssh git@github.com. You will get an error saying GitHub doesn't provide shell access, but should get a "You've successfully authenticated" message.
Now, I've been a user and fan of the tools TortoiseCVS and TortoiseSVN, so I tried to use TortoiseGit, however, I had a few problems - it didn't seem to think msysgit was installed no matter what path I gave it, so I'll stick with the git console for the time being.
Next up, we want to create our repository in GitHub, then see if we can clone it, add a file, and push our changes back to GitHub.
Back in the browser in GitHub, click the link to create a new repository. I created with the name texas-holdem-kata and a suitable description.
In the git console, we just enter the commands as listed on GitHub:
cd <your project location>
git config --global user.name "Your Name"
git config --global user.email "Your Email"
git init
touch README
git add README
git commit -m 'initial commit of test readme file'
git remote add origin git@github.com:<your repository>
git push origin master
It worked! Not much about the above commands is too different to what I'm used to in SVN - we have the usual add and commit. We do have the couple of extra 'remote' and 'push' commands, but I'm happy being a little ignorant for the moment.
Next for the hard part: actually working on the kata. Still, I feel a strange sense of accomplishment right now!
