Skip to content

Instantly share code, notes, and snippets.

@yii2-developer
Created February 9, 2016 14:05
Show Gist options
  • Save yii2-developer/1950be2f6973c898a47f to your computer and use it in GitHub Desktop.
Save yii2-developer/1950be2f6973c898a47f to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BASE_DIR=/var/www/html
SUDO_USER='sudo -u site -H'
GIT="$SUDO_USER /usr/bin/git"
cd $BASE_DIR
$GIT fetch --all
$GIT reset --hard origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment