Skip to content

Instantly share code, notes, and snippets.

@seanblanton
Created April 3, 2017 05:04
Show Gist options
  • Save seanblanton/14a8de7d8e2415176d826fb6ec1efd4e to your computer and use it in GitHub Desktop.
Save seanblanton/14a8de7d8e2415176d826fb6ec1efd4e to your computer and use it in GitHub Desktop.
Extract a specific folder in a post-receive hook
#!/bin/sh
git --work-tree=/var/www/html/ --git-dir=/var/repo/site.git checkout -f master -- dist/
cd /var/www/html/
cp -rRp dist/. .
rm -rf dist
// -rRp recursive copy files from /dist to current folder. Then delete the empty folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment