Skip to content

Instantly share code, notes, and snippets.

@tdhsmith
Created November 17, 2015 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdhsmith/0c39400ffe8e3cd8b0a3 to your computer and use it in GitHub Desktop.
Save tdhsmith/0c39400ffe8e3cd8b0a3 to your computer and use it in GitHub Desktop.
Git pre-commit username check
#!/bin/bash
if [[ -z "$(git config user.name)" ]]; then
echo "Git username must be defined to commit!"
echo "(Are you running inside Vagrant/Homestead?)"
echo
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment