chore(pre-commit): disallow large files#7576
Merged
Conversation
a0add0b to
387b41b
Compare
Contributor
Greptile SummaryAdded a pre-commit hook to prevent accidentally committing large files (>1MB) to the repository, helping maintain git history cleanliness and repository performance.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Git as Git
participant PreCommit as Pre-commit Framework
participant Hook as check-added-large-files
Dev->>Git: git add <files>
Dev->>Git: git commit
Git->>PreCommit: Trigger pre-commit hooks
PreCommit->>Hook: Run check-added-large-files
Hook->>Hook: Check each added file size
alt File > 1000KB
Hook->>PreCommit: Return failure
PreCommit->>Git: Block commit
Git->>Dev: Show error message
else All files ≤ 1000KB
Hook->>PreCommit: Return success
PreCommit->>Git: Allow commit
Git->>Dev: Commit successful
end
|
387b41b to
a705943
Compare
justin-tahara
approved these changes
Jan 20, 2026
rohoswagger
pushed a commit
that referenced
this pull request
Jan 20, 2026
jessicasingh7
pushed a commit
that referenced
this pull request
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Large files are easy to accidentally check in and very sticky in git history, so let's be intentional about checking them in.
There are currently 2 files over the limit, and neither are expected to be updated regularly,
How Has This Been Tested?
prek run --all-filesAdditional Options
Summary by cubic
Add a pre-commit hook to block files larger than 1.5 MB from being committed. This prevents accidental large binaries and keeps git history lean.
New Features
Migration
Written for commit a705943. Summary will update on new commits.