Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danwt opened this issue Jan 28, 2022 · 1 comment

Comments

@danwt
Copy link
Contributor

danwt commented Jan 28, 2022

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
Copy link
Contributor Author

danwt commented Mar 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant