#!/bin/bash path=YOUR_DEPLOY_DIR cd $path # Save local changes git stash # Auto deploy by using hard reset git fetch --all git reset --hard origin/master