Skip to content

R2-G2/GitHooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHooks: my default Git hooks

Setup

Universal

Create the hooks templatedir.

mkdir -p /CUSTOM/PATH/hooks

Announce the templatedir to Git.

editor /PATH/TO/.gitconfig
[init]
	templatedir = /CUSTOM/PATH

Personal

mkdir -p ~/.gittemplates/hooks
vim ~/.gitconfig
[init]
	templatedir = ~/.gittemplates

Usage

post-commit

First install sl (Steam Locomotive) and then create a symlink.

After committing, a steam locomotive will cross the terminal, trying to prevent you from pushing to early. Spoiler: This won't always help!

Universal

ln -s "$(readlink -m ./post-commit.sh)" /CUSTOM/PATH/hooks/post-commit

Personal

ln -s "$(readlink -m ./post-commit.sh)" ~/.gittemplates/hooks/post-commit

Problems?

Fork! Fork it! Fork you! Fork me, right?