Created
February 4, 2015 21:43
-
-
Save cchacin/9039dd5df5b2c320927a to your computer and use it in GitHub Desktop.
Ondir configuration to change git config user.* preferences
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
enter ~/Git/work/([^/]+) | |
if [ -r .git ]; then | |
git config user.name "Username"; | |
git config user.email "[email protected]"; | |
echo 'Switched to git user/email settings for [email protected] - WORK.'; | |
fi | |
enter ~/Git/personal/([^/]+) | |
if [ -r .git ]; then | |
git config user.name "Username"; | |
git config user.email "[email protected]"; | |
echo 'Switched to git user/email settings for [email protected] - PERSONAL.'; | |
fi |
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
# ondir configuration | |
cd() { | |
builtin cd "$@" && eval "`ondir \"$OLDPWD\" \"$PWD\"`" | |
} | |
pushd() { | |
builtin pushd "$@" && eval "`ondir \"$OLDPWD\" \"$PWD\"`" | |
} | |
popd() { | |
builtin popd "$@" && eval "`ondir \"$OLDPWD\" \"$PWD\"`" | |
} | |
eval "`ondir /`" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment