Created
October 2, 2014 15:42
-
-
Save kenyonj/1cc08a9e7583f2be856d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# set gitconfig.local keys and define gpair() and gsolo() | |
gh_name=("${(s/ /)$(echo `git config user.name`)}") | |
gh_email=("${(s/@/)$(echo `git config user.email`)}") | |
gh_co_domain=$(echo `git config company.domain`) | |
# set the company email domain name in gitconfig.local, only do this once | |
if [[ $gh_co_domain == "" ]]; then | |
echo "\nPlease enter your company email domain name: [thoughtbot.com] " | |
read co_domain | |
if [[ $co_domain == "" ]]; then | |
new_domain="thoughtbot.com" | |
else | |
new_domain=$co_domain | |
fi | |
git config --file ~/.gitconfig.local --add company.domain $new_domain | |
gh_co_domain=$(echo `git config company.domain`) | |
fi | |
gpair() { git commit --amend --no-edit --author "$gh_name & $1 $2 <$gh_name[1]:l+$1:l@$gh_co_domain>" } | |
gsolo() { git commit --amend --no-edit --author "$gh_name <$gh_email[1]@$gh_email[2]>" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment