Git pre-commit hook for auto formating

I own the repository: And our team needed a hook that formats the source code before the commit. This needs to be done automatically, but the .git directory cannot be added to the repository.
Is it possible to get access to add directories or another way to solve this?

1 Like