I am using the following pre-commit-config.yaml:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
This correctly prevents adding files larger than 500 KB.
With the following .gitattributes:
large_files/large_file.db filter=lfs diff=lfs merge=lfs -text
I am able to commit large_file.db successfully.
Issue:
If i delete .gitattribute and run :
git lfs track ./large_files/
This generates a new .gitattributes:
large_files/ filter=lfs diff=lfs merge=lfs -text
In this case, pre-commit prevents committing files inside large_files/, even though they are tracked by Git LFS.
Output of git lfs status --porcelain
A .gitattributes
A .pre-commit-config.yaml
A large_files/large_file.db
A large_files/large_file2.db
Environment
Git version: git version 2.51.2.windows.1
pre-commit version: pre-commit 4.6.0
I am using the following pre-commit-config.yaml:
This correctly prevents adding files larger than 500 KB.
With the following
.gitattributes:I am able to commit large_file.db successfully.
Issue:
If i delete
.gitattributeand run :This generates a new
.gitattributes:In this case,
pre-commitprevents committing files insidelarge_files/, even though they are tracked by Git LFS.Output of
git lfs status --porcelainEnvironment
Git version:
git version 2.51.2.windows.1pre-commit version:
pre-commit 4.6.0