Skip to content

Instantly share code, notes, and snippets.

@psaunders88
Last active March 2, 2016 21:07
Show Gist options
  • Save psaunders88/54f1daf1f2cded0f51b3 to your computer and use it in GitHub Desktop.
Save psaunders88/54f1daf1f2cded0f51b3 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /var/www/
PROJECT_DIR_NAME="DiTest"
TIME="`date +%Y%m%d%H%M%S`"
# save copy of old file somewhere
cp -R $PROJECT_DIR_NAME backups/$PROJECT_DIR_NAME-$TIME
# Remove existing folder
rm -R $PROJECT_DIR_NAME
# clone from master without git files
git --git-dir=/dev/null clone --depth=1 https://github.com/psaunders88/DiTest.git $PROJECT_DIR_NAME
rm -R $PROJECT_DIR_NAME/.git
# Composer update
cd $PROJECT_DIR_NAME
composer install
cd ../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment