Skip to content

Instantly share code, notes, and snippets.

@catrider
catrider / update
Last active August 29, 2015 14:16
Git server-side 'update' hook to reject changes to 'release' branches if the changes contain one or more commits present on the 'develop' branch
#!/bin/bash
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
$(echo $refname | grep -q /release/)
on_release_branch=$?
if [ $on_release_branch -eq 0 ] && [ "$oldrev" != "0000000000000000000000000000000000000000" ]; then