From: Colin Patrick Mccabe Date: Tue, 14 Feb 2012 16:10:28 +0000 (-0800) Subject: Create git-identity.sh X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9374e89eef8115bf1680585eb32ab11bb1942525;p=cmccabe-bin Create git-identity.sh Signed-off-by: Colin McCabe --- diff --git a/git-identity.sh b/git-identity.sh new file mode 100755 index 0000000..5c4c0f1 --- /dev/null +++ b/git-identity.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# +# Configure git identities on a repo-by-repo basis +# +# Colin Patrick McCabe +# + +die() { + echo $@ + exit 1 +} + +[ $# -eq 1 ] || die "You must supply one argument: work or priv" +case $1 in + work) + git config user.email cmccabe@cloudera.com --file || die "${LINENO}" + git config user.name "Colin Patrick Mccabe" --file || die "${LINENO}" + ;; + priv) + git config user.email cmccabe@alumni.cmu.edu --file || die "${LINENO}" + git config user.name "Colin Patrick Mccabe" --file || die "${LINENO}" + ;; + *) + die "logic error" + ;; +esac + +exit 0