https://github.com/techpulsetoday/append-actual-date-time-to-git-commit-message
Append actual date and time to git commit message
https://github.com/techpulsetoday/append-actual-date-time-to-git-commit-message
git gitcommit gitconfig
Last synced: 10 months ago
JSON representation
Append actual date and time to git commit message
- Host: GitHub
- URL: https://github.com/techpulsetoday/append-actual-date-time-to-git-commit-message
- Owner: techpulsetoday
- Created: 2018-11-10T04:45:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T14:51:29.000Z (almost 7 years ago)
- Last Synced: 2025-01-14T03:11:57.194Z (12 months ago)
- Topics: git, gitcommit, gitconfig
- Language: Shell
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# commit-msg
Append actual date and time to git commit message
# Table of Contents
1. [Enable git templates](#enable-git-templates)
2. [Create a directory to hold the global hooks](#create-a-directory-to-hold-the-global-hooks)
3. [Write your hooks in ```~/.git-templates/hooks.```](#write-your-hooks-in-git-templateshooks)
4. [Make sure the hook is executable](#make-sure-the-hook-is-executable)
5. [Re-initialize git in each existing repo](#re-initialize-git-in-each-existing-repo-youd-like-to-use-this-in)
## Enable git templates:
```shell
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:
```shell
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):
```shell
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:
```shell
chmod a+x ~/.git-templates/hooks/commit-msg
```
## Re-initialize git in each existing repo you'd like to use this in:
```shell
git init
```
NOTE if you already have a hook defined in your local git repo, this will not overwrite it.