Skip to content

Instantly share code, notes, and snippets.

@xezrunner
xezrunner / pre-commit-nocheckin
Last active September 2, 2025 17:24
nocheckin pre-commit hook for Git
#!/bin/bash
# Author: xezrunner (github.com/xezrunner)
# Inspired by Jonathan Blow's nocheckin setup with SVN (twitch.tv/j_blow) (youtube.com/@jblow888)
# Credits to DustinGadal on r/Jai: reddit.com/r/Jai/comments/jp0vjy/nocheckin_behavior_in_gitsourcetree/gbfhzd1
# gist.github.com/xezrunner/e6dbafcc21fcbc976c93bdee0f371a08
# This pre-commit hook checks for the keyword "$NOCHECKIN_KEYWORD" in staged files,then aborts the commit
# if any matches were found, with output of file path, line number and match preview.