Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 948 Bytes

README.md

File metadata and controls

61 lines (40 loc) · 948 Bytes

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?