Skip to content

Instantly share code, notes, and snippets.

@Elektordi
Last active January 19, 2016 01:36
Show Gist options
  • Save Elektordi/bb931faf00e4c30462a7 to your computer and use it in GitHub Desktop.
Save Elektordi/bb931faf00e4c30462a7 to your computer and use it in GitHub Desktop.
How to update production files on push from your computer (when your servers can't reach your git server)
#!/bin/sh
# Copy me at .git/hooks/post-receive
# And remember to set this in .git/config:
#
#[receive]
# denyCurrentBranch = no
# Working directory is .git
cd ..
echo "Push OK. Updating files..."
GIT_DIR=".git" git reset --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment