#!/bin/bash GIT_DIR="/home/developideas/project.git" TARGET="/home/developideas/project" BRANCH="master" PM2_NAME="Project" echo 'post-receive: Triggered.' cd $TARGET echo 'post-receive: git check out…' git --git-dir=$GIT_DIR --work-tree=$TARGET checkout $BRANCH -f echo 'post-receive: npm install…' npm install echo 'post-receive: → done.' pm2 restart -s $PM2_NAME echo 'post-receive: app started successfully with pm2.