question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.pre-commit directory is not cleaned up

See original GitHub issue

I noticed at one point that my ~/.pre-commit directory was 3G in size, which seems pretty large.

I asked around and @struys said:

jtwang: we don’t do garbage collection so when you get a new version of hooks, the old one stays there jtwang: you can also use pre-commit clean to remove the files rm’ing the directory directly isn’t a great idea jtwang: mind filing a ticket on pre-commit - https://github.com/pre-commit/pre-commit we should add some form of GC based on the last time you used a hook repo

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Jan 8, 2019

This has been released as part of v1.14.0 🎉 – thanks again!

0reactions
asottilecommented, Jan 3, 2019

#906 implements a thing which:

  • keeps track of the .pre-commit-config.yaml files in the pre-commit db
  • adds a pre-commit gc command which cleans all repos which aren’t referenced
Read more comments on GitHub >

github_iconTop Results From Across the Web

In Git pre-commit hook, temporarily remove all changes that ...
Git tracks only files, not directories. However, the command git clean can remove directories. As the result, the script will remove empty ...
Read more >
pre-commit
new in 1.14.0: a commit is no longer necessary to try-repo on a local directory. pre-commit will clone any tracked uncommitted changes. ~/work/hook-repo...
Read more >
FAQ • precommit - Lorenz Walthert's
If that does not work, run $ pre-commit clean to clean the pre-commit cache. Then, try again. Although you could also clear the...
Read more >
Extend your pre-commit hooks with AWS CloudFormation Guard
We will also provide patterns you can use to centrally maintain a list of rules that security teams can use to roll out...
Read more >
Keep your code clean using Black & Pylint & Git Hooks & Pre ...
Sign up for Medium and get an extra one ... Create the file pre-commit in the folder .git/hooks/. You should not include any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found