Git Tip: Set Your Identification and Colours

Absolute must-do for any new git users out there: set your name and email, so people can know who did what in the code!

git config --global "John Doe"
git config --global "[email protected]"

Also, if you’re a command-line user (and who isn’t?!), make sure you configure it to add a splash of colour to its output. It’s really useful.

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

Oh, and in case you’re pair programming, this little script goes a long way:

#!/usr/bin/env ruby

def usage
puts "./pair [name] [name]: pair two people"

usage if ARGV.size != 2

pair = [ARGV[0], ARGV[1]]

puts "pairing #{pair.first} and #{pair.last}"
`git config "#{pair.first} & #{pair.last}"`
`git config #{pair.first}+#{pair.last}`

And that’s it :)