Created
May 15, 2014 15:15
-
-
Save nwjlyons/c520ec34301b8e4ed959 to your computer and use it in GitHub Desktop.
Delete .pyc files and empty directories on git checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
# Delete .pyc files and empty directories. | |
find . -name "*.pyc" -delete | |
find . -type d -empty -delete | |
echo "$(tput bold).pyc files and empty directories deleted.$(tput sgr0)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create file
.git/hooks/post-checkout
and paste this gist. File needs to be executablechmod +x .git/hooks/post-checkout