Skip to content

Instantly share code, notes, and snippets.

@adamcharnock
Created April 22, 2014 11:28
Show Gist options
  • Save adamcharnock/11175057 to your computer and use it in GitHub Desktop.
Save adamcharnock/11175057 to your computer and use it in GitHub Desktop.
.git/hooks/post-checkout
#!/bin/bash
echo "Cleaning up .pyc files and empty directories"
REPO_ROOT=./$(git rev-parse --show-cdup)
# Delete .pyc files and empty directories.
find $REPO_ROOT -name "*.pyc" -delete
find $REPO_ROOT -type d -empty -delete
@adamcharnock
Copy link
Author

Make sure you do chmod +x .git/hooks/post-checkout once you have put it in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment