Created
January 14, 2014 16:00
-
-
Save timblair/8420669 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
#!/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