Skip to content

Instantly share code, notes, and snippets.

@timblair
Created January 14, 2014 16:00
Show Gist options
  • Save timblair/8420669 to your computer and use it in GitHub Desktop.
Save timblair/8420669 to your computer and use it in GitHub Desktop.
#!/bin/bash
function set_git_config() {
read -e -p "$2 ($3): " INPUT && [[ ! "$INPUT" ]] && INPUT="$3"
git config --global "$1" "$INPUT"
}
GITNAME=$(finger `whoami` | awk -F: '{ print $3 }' | head -n1 | sed 's/^ //')
GITMAIL="$(whoami)@blah.com"
set_git_config "user.name" "Enter your full name" "$GITNAME"
set_git_config "user.email" "Enter your email address" "$GITMAIL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment