Re:Stop Using Git Ignore
by eddiejaoude on Sunday August 18, 2024 @04:26PM
(#41285202)
thank you for your detailed replied. The Git hook is an interesting idea, I use Git Husky for git hooks, and checking the mime type could be good to avoid files like screenshots being committed
I will look into this idea. Thanks again
The first place to catch errant build files and artifacts from entering the repo database is the .gitignore file. The second place to catch them is the PR. The .gitignore prevents repetitive file adds from entering the PR.
What I don’t want to see in an enterprise environment is someone checking in a 100MB binary file that gets checked into dev because the team was busy and approved a PR hastily. What would be helpful is a git hook that checks the mime type of a file and decide if it should even by a type of file that should be checked into a project.