Skip to content

Instantly share code, notes, and snippets.

@bikram990
bikram990 / git pre-receive hook
Created September 27, 2022 04:57
git pre-receive hook to reject commits not matching a certain pattern
#!/usr/bin/env ruby
# uncomment following if using update hook script
# $refname = ARGV[0]
# $oldrev = ARGV[1]
# $newrev = ARGV[2]
# pre-receive hook script get these values at STDIN
$input = STDIN.gets
inputs = $input.split(' ')