Last active
January 26, 2021 15:44
-
-
Save trueheart78/2ffabced0e0cdc91144b12b528de378f to your computer and use it in GitHub Desktop.
Git Init Prompt
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
| # 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