Skip to content

techpulsetoday/append-actual-date-time-to-git-commit-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

commit-msg

Append actual date and time to git commit message

Table of Contents

  1. Enable git templates
  2. Create a directory to hold the global hooks
  3. Write your hooks in ~/.git-templates/hooks.
  4. Make sure the hook is executable
  5. Re-initialize git in each existing repo

Enable git templates:

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

Create a directory to hold the global hooks:

mkdir -p ~/.git-templates/hooks

Write your hooks in ~/.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/

Make sure the hook is executable:

chmod a+x ~/.git-templates/hooks/commit-msg

Re-initialize git in each existing repo you'd like to use this in:

git init

NOTE if you already have a hook defined in your local git repo, this will not overwrite it.

About

Append actual date and time to git commit message

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages