Use bit.ly to Name Gists

Let’s say you’ve got a cool Gist you want to share, but don’t love the boring URL. No problem. Just use bit.ly.

bit.ly is a URL shortener which lets you specify the identifier. I setup http://bit.ly/WeatherBot for ntalbot’s WeatherBot rock paper scissors script.

bit.ly also tracks click throughs, for that extra bit of ego boost.

Update: Fixed link.

Mirroring to GitHub

The flogic guys have a great write up detailing their setup. They go into detail on how to setup a local mirror to use when deploying your app.

Here’s a summary, in their own words:

Here’s how we’re doing the mirroring… In the discussion that follows there are three machines involved: (1) a local workstation (or laptop, as the case actually is) where I’m doing development work, I’ll refer to it as “local”; (2) a git repository host under our control, which will be running gitosis, to which we push, and which then mirrors to github, called “internal”; and (3) github.com.

Update: I forgot to link to the blog post outside of the image. Thanks Matt.

Blueprint CSS on GitHub

Blueprint CSS, everyone’s favorite CSS framework, has moved to GitHub.

Straight from the horse’s mouth:

Blueprint is a CSS framework, which aims to cut down on your CSS development time. It gives you a solid CSS foundation to build your project on top of, with an easy-to-use grid, sensible typography, and even a stylesheet for printing.

GHC (Haskell) Moving to Git

The Haskell guys got together, evaluated the options, and decided Git was the best choice.

It came down to two things: the degree of support available, and
flexibility of the tools (git is much happier to let you modify the history
than Mercurial). Speed ruled out bzr, and Windows support is less of an
issue: git appears to work reasonably well on Windows these days.

Check out the GHC mirror on GitHub to follow along. Score one more for the good guys.

A Git deployment workflow

Bryan Helmkamp of weplay has published his team's Git deployment workflow over on his blog. It includes a bunch of Rake tasks which we've Gist'd for your convenience.

# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow

module GitCommands
  extend self

  def diff_staging
    `git fetch`
    puts `git diff origin/production origin/staging`
  end

  def tag_staging(branch_name)
    verify_working_directory_clean

    `git fetch`
    `git branch -f staging origin/staging`
    `git checkout staging`
    `git reset --hard origin/#{branch_name}`
    `git push -f origin staging`
    `git checkout master`
    `git branch -D staging`
  end

  def tag_producton
    verify_working_directory_clean

    `git fetch`
    `git branch -f production origin/production`
    `git checkout production`
    `git reset --hard origin/staging`
    `git push -f origin production`
    `git checkout master`
    `git branch -D production`
  end

  def branch_production(branch_name)
    verify_working_directory_clean

    `git fetch`
    `git branch -f production origin/production`
    `git checkout production`
    `git branch #{branch_name}`
    `git checkout #{branch_name}`
    `git push origin #{branch_name}`
  end

protected

  def verify_working_directory_clean
    return if `git status` =~ /working directory clean/
    raise "Must have clean working directory"
  end
end


namespace :tag do
  desc <<-DESC
    Update the staging branch to prepare for a staging deploy.
    Defaults to master. Optionally specify a BRANCH=name
  DESC

  task :staging do
    branch_name = ENV['BRANCH'] || "master"
    GitCommands.tag_staging(branch_name)
  end

  desc "Update the remove production branch to prepare for a release"
  task :production => ['diff:staging'] do
    GitCommands.tag_production
  end
end

namespace :diff do
  desc "Show the differences between the staging branch and the production branch"
  task :staging do
    GitCommands.diff_staging
  end
end

namespace :branch do
  desc "Branch from production for tweaks or bug fixs. Specify BRANCH=name"
  task :production do
    branch_name = ENV['BRANCH']
    raise "You must specify a branch name using BRANCH=name" unless branch_name
    GitCommands.branch_production
  end
end

namespace :deploy do
  desc "Tag and deploy staging"
  task :staging => "tag:staging" do
    `cap staging deploy:long`
  end
end

Maven-enabled project hosting

mrdon has an excellent blog post explaining how to use GitHub with Maven. Not just read-only, either – mrdon’s solution handles pushing the git repository changes to GitHub transparently.

The post closes with a choice quote, too:

I’m convinced forks are a good thing for the software development community, especially if there is a solid means in place to track such forks in such a way that both parties benefit.

(Hat tip to myabc)

The Post-Apocalyptic Guide

Worried about GitHub going down? Host not found errors in the middle of your deploy? Fear not! guitsaru" has written a guide on what to do When GitHub Goes Bad.

Currently covered:

  • What if my GitHub repository is corrupted or deleted?
  • How can I share my repository if GitHub goes down?
  • How do I deploy my application when GitHub is down?

Getting Real

A post I wrote about applying 37signals’ Getting Real to GitHub is up on their product blog:

How GitHub used Getting Real to pick a fight, scratch their own itch, and stay lean.

Upcoming Speaking Gigs

In the next month I will be keynoting the Ruby Hoedown (August 8-9) and speaking at erubycon (August 15-17). If you’re at either of these events stop by and say hi.

Interested in having someone from GitHub talk at your conference about Git, distributed source control, the future, or the history of Temüjin’s conquests? Email chris@logicalawesome.com.

New to Git?

Know someone new to Git? Here are some awesome resources to start with:

  • GitCasts – Short and sweet screencasts on a variety of Git topics

Update: Added ‘Git for designers.’

Intro to Gist Video

bryanl has posted a video explaining Gist. Check it out!


BryanL demos Gist: A Super Hot Pastebin from Bryan Liles on Vimeo.

Easy Peezy Capistrano Deployment

The guys over at EdgeCase have written up a guide on Easier Capistrano Deployments from GitHub. It explains how to setup and use the :forward_agent option when you deploy. Nice!

Dashboard Widget

The stand up fellas over at New Leaders have created a GitHub Dashboard Widget for OS X. Check it out – very slick!

Fork You Sighting #2

(Thanks mathie!)

Supercharged Vim Theme

You TextMate users already have a GitHub theme, but now us Vimiacs can join the fun.

Grab the theme right here. Thanks Bruno!