Skip to content

Instantly share code, notes, and snippets.

@attilagyorffy
Created June 11, 2010 12:17
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 attilagyorffy/434416 to your computer and use it in GitHub Desktop.
Save attilagyorffy/434416 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def usage
puts "./pair [name] [name]: pair two people (set the user in git)"
puts "./pair reset: revert to default settings"
exit
end
if ARGV.size == 2
pair = [ARGV[0], ARGV[1]]
puts "pairing #{pair.first} and #{pair.last}"
`git config user.name <http://user.name> "#{pair.first} & #{pair.last}"`
`git config user.email #{pair.first}+#{pair.last}@unboxedconsulting.com`
elsif ARGV.size == 1 and ARGV[0] == 'reset'
puts "Reverting to default git config options"
`git config --unset user.name`
`git config --unset user.email`
else
usage
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment