modelator-py icon indicating copy to clipboard operation
modelator-py copied to clipboard

Operations: add git hooks that will delete empty directories when changing branch

Open danwt opened this issue 3 years ago • 1 comments

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

danwt avatar Jan 28 '22 13:01 danwt

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.

danwt avatar Mar 30 '22 14:03 danwt