Skip to content

Instantly share code, notes, and snippets.

@skyler
Last active August 29, 2015 13:56
Show Gist options
  • Save skyler/8852680 to your computer and use it in GitHub Desktop.
Save skyler/8852680 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# save this file to $repo_dir/.git/hooks/post-checkout
# make it executable and symlink it to $repo_dir/.git/hooks/post-merge
# Delete .pyc files and empty directories from root of project
cd ./$(git rev-parse --show-cdup)
find . -type f -name "*.pyc" \
! -path "./git/*" \
! -path "./bower_components/*" \
! -path "./node_modules/*" \
! -path "./support/*" \
! -path "./coefficient/*" \
! -path "./alembic/*" \
-print0 | xargs -0 rm > /dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment