In a folder :
- copy this script in a file
watch.sh:
#!/usr/bin/env bash
set -euo pipefail
function watch {(
cd repo
git remote update 2>/dev/null 1>/dev/null
LOCAL=$(git rev-parse @)
BASE=$(git merge-base @ "@{u}")
if [ "$LOCAL" = "$BASE" ]; then
action
fi
)}
function action {(
echo "Need to pull"
# do something
)}
watch- clone the repo you want to watch :
git clone https://github.com/:author/:repo repo- run the script via
cronor manually