The Joys of Git


Working on PsyDuk has become a little frustrating since I’ve never used any source control before. I did try to use TortoiseSVN, but that ended up being a miserable failure. The manual approach, however, was getting a little bit out of hand:

wasn't going well at all

Even with only 5 versions, it was still quite messy.


I had heard of GitHub before, and after asking in the Hak5 IRC Channel, I figured I would give it a try, however I ran into a small hiccup.

When signing up, it asked for an SSH public key. Problem is, I already have a SSH keypair for connecting to the servers at my University. Some quick googling showed that ~/.ssh/config could solve my problems, so I generated a key pair, moved the keys around, and set up ~/.ssh/config as follows:

Host <uni server non-FQDN>
HostName <uni server FQDN>
IdentityFile ~/.ssh/keys/<uni server FQDN>/id_rsa
PasswordAuthentication no
Port 22
User <username>

Host github
HostName github.com
IdentityFile ~/.ssh/keys/github.com/id_rsa
Port 22
User git
TCPKeepAlive yes
IdentitiesOnly yes

However, a small yet strange problem stopped me later. Going through the instructions to set up a repository, I simply has to run “git push origin master”, and everything would supposedly get uploaded to GitHub. In practice, it gave me a SSH key error.

Some more googling showed that if I could SSH as git@githib.com, “git push origin master” should work. Yet wierdly, I could SSH in normally, but git still threw a tantrum.

After some 20 minutes of messing with it, I tried changing “Host github” in ~/.ssh/config to “Host github.com”. It worked.

I hate it how the smallest bugs can cause the wierdest issues. Often (in my experience) when a strange and complex bug pops up, it’s a small thing that caused it.

Oh well. At least I managed to get PsyDuk up on GitHub, and learned how to set up multiple SSH keypairs. That’ll come in useful.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: