Skip to content

Instantly share code, notes, and snippets.

@milo
Created July 23, 2015 11:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milo/63232a8279b713fe05b3 to your computer and use it in GitHub Desktop.
Save milo/63232a8279b713fe05b3 to your computer and use it in GitHub Desktop.
Git hook for purging cache
#!/bin/sh
# Save as .git/hooks/post-merge
# Set execute bit like: chmod ug+x .git/hooks/post-merge
purgePath="temp/cache"
echo
echo -n "HOOK [Purge cache]: "
if [ -d "$purgePath" ]; then
rm -r "$purgePath"
echo "purged"
else
echo "does not exist, not purged"
fi
$ git pull
Updating ca87888..7033e58
Fast-forward
app/code/modules/Help/Homepage.default.latte | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
HOOK [Purge cache]: purged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment