Last active
December 27, 2015 10:39
-
-
Save pasela/7313176 to your computer and use it in GitHub Desktop.
[git] Prevent commits from default user.
This file contains 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
#!/bin/sh | |
git config user.name >/dev/null && git config user.email >/dev/null | |
if [ $? -ne 0 ]; then | |
cat <<EOF | |
Error: Attempt to commit by default user. | |
$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> | |
Please set user.name and user.email using following commands. | |
git config user.name <YOUR_NAME> | |
git config user.email <YOUR_EMAIL> | |
EOF | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment