Skip to content

Instantly share code, notes, and snippets.

@johnantoni
Created May 4, 2009 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnantoni/106585 to your computer and use it in GitHub Desktop.
Save johnantoni/106585 to your computer and use it in GitHub Desktop.
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 user.name "John Doe"
git config --global user.email "john.doe@company.com"
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"
exit
end
usage if ARGV.size != 2
pair = [ARGV[0], ARGV[1]]
puts "pairing #{pair.first} and #{pair.last}"
`git config user.name "#{pair.first} & #{pair.last}"`
`git config user.email #{pair.first}+#{pair.last}@company.com`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment