git

Git (and its ilk) are tools for working collaboratively (especially with hosted services). Your commit messages are your best weapon for communicating context, and every collaborator, including Future You, depends on context to be productive. It’s not opinion, it’s Science!

See, human memory is so bad it can be erased by passing through a doorway. We can defeat doorway-induced time wasting (not to mention the change of screaming “what the hell is this?!” at code someone, maybe Past You, wrote) with great commit messages.

Randall from http://www.xkcd.com knows what's up.
(Image courtesy of XKCD because Randall is a champ.)

A great commit message:

  • Is never ‘left behind’ by code changes (unlike comments)
  • Gives all the info you need (ticket numbers, reasons for change, expected behaviour changes)
  • Shows relevant changes around your change
  • Summarises everything in 50 characters or less as the ‘subject line’

All this info, the context of the change, makes problem solving (read: coding) more efficient.  Good context helps any collaborator; there’s evidence that context-based approaches to problem solving are more effective.

Continue Reading

Because this just tripped me up, and I’d like to think that I’m not the only totally braindead developer out there.

Git is wonderful. You shouldn’t use any other source control. Even if your co-workers don’t get it (It’s because they’re stupid). Disk is cheap, you can afford to keep it all local. It’s fast, it’s flexible, it’s not actually that hard either.

But sometimes you might be trying to fetch a remote branch from your development server. You’ve checked documentation for the syntax and you know you can show your remote branches by issuing git branch -r, and the branch you want isn’t there.

What the Fuck?

Well, it’s actually embarassingly simple and not worth the 5 minutes you spent re-reading the documentation like a cargo-culting toddler whining about how unfair it is he has to eat dinner(“But it says this should wooooooorrrrrkkkkkkk!“).

git pull

.

That’s all. git pull won’t bring across any changes for the current branch (because there aren’t any) but it will bring across metadata changes, like new branches.

FFFFFFFUUUUUUUUUUUU………