-
-
Save attilagyorffy/434416 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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