A blog about technology, photography, and stuff

Tuesday, October 25, 2011

How to have multiple remotes for you Git project

When I found out that BitBucket added support for Git, I got pretty excited.

Just this past year I started to use Git as my DVCS for all my projects. More importantly, my older projects didn't have any version control whatsoever. They were projects spread across multiple computers that only merged into a single external USB hard drive when I started to retire some computers because they were just too old (six plus years!).

Anyway, when this external drive began to make noises (clicking sounds), I decided I wanted to have my old projects stored in the cloud in case the the hard drive should ever fail.

Github was my goto host as it was immensely popular. At first I was on the free plan (unlimited public repos), but I decided my ugly legacy code shouldn't be public, and went with their micro plan ($7 per month for 5 private repos). These projects are retired and there is no plan for future development. I just want them hosted with my other active personal projects.

I signed up for BitBucket not too long ago just because I wanted to play with Mercurial. That didn't last very long. But with the new additional support for Git, and with the free unlimited private and personal projects, I knew I wanted to add this as a remote to also host all my projects.

But how was I to add another remote since I was already using Github? I wanted to add BitBucket as a remote along with Github. With a simple search on StackOverflow, I came across pull/push from multiple remote locations (answer).

Here is an example .git/config setting, with the bolded text the example text to add a remote:
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[branch "master"]
        remote = origin
        merge = refs/heads/master
[remote "origin"]
        url = git@github.com:sunpech/project_foo.git
        url = git@bitbucket.org:sunpech/project_foo.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "heroku"]
        url = git@heroku.com:project_foo.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
Now when I push changes, it pushes it to both Github and BitBucket. Simple, and it works. Hope this helps.

Of course you'll still need to set up the project on each respective host, in which case I'll point you to this Github setup tutorial (also see Using SSH to Access your Bitbucket Repository).

I have this setup because I may choose to abandon my Github pay account, and just host my public repos there, and all my private repos on BitBucket-- saving me $7/month. Plus, I think it's great for Github to have competition.

Monday, October 24, 2011

BlizzCon 2011

Over the weekend I went with my sister and friends to check out BlizzCon at the Anaheim Convention Center. Obviously we're all fans of the games that Blizzard Entertainment make, and it was everyone's first time attending. We had a blast!

It was a very tiring two days (Friday and Saturday, Oct 21-22, 2011). Doors opened around 9-9:30am, and the events lasted until midnight! I went around and snapped photos as much as I could, while attending some panels and Starcraft 2 tournaments. Some of the costume designs were extraordinary. Major props to the fans that hand made their own costumes.

On Friday, was the day attendees wore the intricate costumes. Major announcements were made as well as the GSL (Global Starcraft League) finals. IM_MVP and SlayersS_MMA were the finalists with the Terran vs Terran matchup. I was cheering for the underdog, MMA, who won.

On Saturday, the lines for the game demos were much longer. A lot more kids also came out too, as the previous day is a school day. I took it easier and watched more SC2 matches until the BlizzCon finals came up, pitting IM_MVP (Terran) against IM_Nestea (Zerg). Of course I cheered on the underdog as well as the Zerg player. The closing ceremony was fantastic, as the Foo Fighters came out to perform!

Overall, a super fun convention gathering the largest set of loyal game fans under one roof. I plan to attend next year!

The full album can be found here.
Here are some of my favorite pictures I took:

More pics from other photographers (source):