Skip to content

Instantly share code, notes, and snippets.

@wolkenschieber
wolkenschieber / git-pre-receive-hook.sh
Created July 8, 2016 09:59 — forked from caniszczyk/git-pre-receive-hook.sh
A reasonable git pre-receive-hook
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.