modelator-py
modelator-py copied to clipboard
Operations: add git hooks that will delete empty directories when changing branch
Tools in the python ecosystem often leave cache directories (__pycache__). These occupy otherwise empty directories when changing branches and get in the way of having a clean workspace. It may be possible to add git hooks to automatically clean up these empty directories.
See this [stackoverflow post](https://stackoverflow.com/questions/1504724/automatically-remove-pyc-files-and-otherwise-empty-directories-when-i-check-ou
and this gist
I looked into this and it takes a bit of work to introduce custom hooks, especially if trying to have multiple functions react to the same hook (post-checkout, in this case). You have to modify the default files in .git/hooks ect.