R2-G2 / GitHooks

[GH] my default Git hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

About

[GH] my default Git hooks

License:MIT License


Languages

Language:Shell 100.0%