This script makes sure the dev site is clean, emails a log summary of updates about to be applied, updates the site and emails me so I know what changed.
I'm using this on a dev site which is periodically updated to the latest master for testing.
#!/bin/bash
cd /var/www/site
git stash
git checkout master
git fetch
git log --oneline master..origin/master | mail -s "site updated " me@example.com [1]
mit merge origin/master
./build.sh
Links:
[1] mailto:me@example.com