--- /dev/null
+#!/bin/sh
+#
+# Post-receive git hook
+#
+
+cd ..
+unset GIT_DIR
+
+if [ -d ".git/annex" ]; then
+ git annex sync
+else
+ git config receive.denyCurrentBranch ignore
+ #git reset HEAD
+ git checkout -f
+fi
+
+git submodule sync --recursive
+git submodule update --init --recursive
+
+cd -
+exec git update-server-info
--- /dev/null
+#!/bin/bash
+#
+# pushtodeploy templater module.
+#
+
+# Parameters
+SHARE="$1"
+
+# Include basic functions
+source $SHARE/templater/functions || exit 1
+
+# pushtodeploy implementation
+function templater_pushtodeploy {
+ if [ ! -e "bin/post-receive" ]; then
+ __templater_echo "Setting up pushtodeploy..."
+
+ mkdir -p bin
+ cp $SHARE/pushtodeploy/files/post-receive bin/
+
+ if [ -e "Makefile" ]; then
+ if ! grep -q "^post_receive:" Makefile; then
+ echo "post_receive:" >> Makefile
+ echo -e "\tcd .git/hooks && ln -sf ../../bin/post-receive" >> Makefile
+ fi
+
+ fi
+ else
+ __templater_echo "pushtodeploy already set"
+ fi
+}
+
+# Dispatch
+templater_pushtodeploy