Adds the tracking screen at pull.php?watch=1: it keeps comparing the deployed commit with the head on GitHub and starts a deploy the moment a new commit shows up. It runs for as long as that page stays open.
For an unattended server use cron instead: curl -s "https://host/pull.php?check=1&plain=1". With check=1 nothing is downloaded while the commit has not changed.
The commit that is currently live is written to pull-state.json next to this script — that file is what makes «deploy only what changed» possible, and it is never overwritten by a pull.
Off: nothing happens on its own, the tracking screen still works but only deploys when you press the button.