- Make sure your git-templates directory is correctly set:
git config --global init.templatedir "~/.git-templates" - Create a
.git-templatesdirectory in your user directory (C:\Users\usernameon Windows) - Add a subdirectory
hooks - Download the
pre-commitfile to the created directory
On every git init and git commit the hooks will be copied over to the new repository.
Whenever a git commit is issued, the pre-commit hook will check if the user.name and user.email are set, if not, it will ask for input.