A rush plugin that can check if files are correctly managed by Git LFS.
Rush.js >= 5.83.2
- Enabling this rush plugin
Please follow the official doc to enable this plugin in your repo.
- Running
git-lfs-check
command
# auto detect changed files by "git diff"
rush git-lfs-check
# or you can specify the files that need to be check\
rush git-lfs-check --file <my_file_name>
# you can add --fix option to auto fix incorrect lfs status
You can specify which paths should be checked by provided a set of glob patterns and the size threshold can be customized.
JSON Schema For configuration
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Configuration for Rush Git LFS plugin",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"default": "http://json-schema.org/draft-04/schema#"
},
"checkPattern": {
"description": "Glob patterns that need to check",
"patternProperties": {
"^.+$": {
"type": "string",
"description": "Customized size threshold for this pattern."
}
}
},
"errorTips": {
"type": "string",
"description": "Tips that shown while there are check errors"
}
}
}
- Ban all png and dll files
{ "checkPattern": { "**/*.png": -1, "**/*.dll": -1 }, }
- Ban all files that larger than 5MB
{ "checkPattern": { "**/*": 5 * 1024 * 124, }, }
- Ban files in particular folder
{ "checkPattern": { "**/some_folder_path": -1, }, }