Append actual date and time to git commit message
- Enable git templates
- Create a directory to hold the global hooks
- Write your hooks in
~/.git-templates/hooks.
- Make sure the hook is executable
- Re-initialize git in each existing repo
git config --global init.templatedir "~/.git-templates"
This tells git to copy everything in ~/.git-templates
to your per-project .git/ directory when you run git init
mkdir -p ~/.git-templates/hooks
For example, here's a commit-msg hook (located in ~/.git-templates/hooks/commit-msg):
wget -N --no-check-certificate --content-disposition https://github.com/techpulsetoday/append-actual-date-time-to-git-commit-message/raw/master/commit-msg -P ~/.git-templates/hooks/
chmod a+x ~/.git-templates/hooks/commit-msg
git init
NOTE if you already have a hook defined in your local git repo, this will not overwrite it.