Skip to content

Instantly share code, notes, and snippets.

@trueheart78
Last active January 26, 2021 15:44
Show Gist options
  • Save trueheart78/2ffabced0e0cdc91144b12b528de378f to your computer and use it in GitHub Desktop.
Save trueheart78/2ffabced0e0cdc91144b12b528de378f to your computer and use it in GitHub Desktop.
Git Init Prompt
# git super command
# make sure with zsh that the git plugin is not used
# as it will override this command
g () {
if [[ $# -gt 0 ]]
then
git "$@"
if [[ `uname` = 'Darwin' && $1 = "init" ]]
then
# prompt for the username and email to use
echo "Will this be a CMM repo?"
select yn in "Yes" "No"; do
case $yn in
Yes ) git_cmm; break;;
No ) git_personal; break;;
esac
done
fi
else
git status
fi
}
# git local repo user
git_personal () {
git config user.name "Your Name"
git config user.email "[email protected]"
}
# git work repo user
git_work () {
git config user.name "Your Name"
git config user.email "[email protected]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment