A sample post-receive git hook:
#!/usr/bin/tcsh
foreach arg ( $< )
set argv = ( $arg )
set refname = $1
end
set branch = `git rev-parse --symbolic --abbrev-ref $refname`
echo $branch
if ( "$branch" == "master" ) then
echo "Branch detected: master"
echo "Do some stuff here."
else if ( "$branch" == "dev" ) then
echo "Branch detected: dev"
echo "Do something else here."
else
echo "Do something entirely different here."
endif
Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.
The HPR Website Design is released to the Public Domain.