1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash # auto-deploy # Usage: auto-deploy /srv/http/repo # fail on any error set -e # Can we write on the clone? test -w "${1}/.git/HEAD" # pull this repo git --git-dir "${1}/.git" \ --work-tree "${1}" \ pull origin master exit $?