Socket
Book a DemoInstallSign in
Socket

lfs-auto-track

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lfs-auto-track

git lfs auto track module

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

LFS Auto Track · Window E2E TestsLinux E2E Tests

lfs-auto-track

If the files bigger than the size (you can configure, check the usage part), when commit, automatically run git lfs track files.

Usage

Step 0: prepare

make sure use husky and lint-staged in the project, and run git lfs install

Step 1: install

npm i lfs-auto-track -D

Step 2: Configure

Add lint-staged script in package.json

{
  "name": "module-name",
  ...
  "lint-staged": {
    "*": [
      "lfs-auto-track 'image,video,audio:100;*:1024'"
    ],
  }
  ...
}

Configuration means

'image,video,audio:100;*:1024' means if mimetype is image/video/audio files's size bigger than 100 KB, and others files bigger than 1024 KB, these files will add to .gitattributes with run command git lfs track automatically;

'*:1024' means any files size bigger than 1024 KB when commit, these files will add to .gitattributes with run command git lfs track automatically;

The size units support B / KB / MB / GB, default is KB

'jpg,png,gif:1MB' means files with extension jpg or png or gif size bigger than 1 MB when commit, these files will add to .gitattributes with run command git lfs track automatically.

Examples

Some questions

  • How to upload the large file after track?
git lfs push --all origin
  • How to clone the project without download the large file?
GIT_LFS_SKIP_SMUDGE=1 git clone THE_REPO_URL
  • How to download the large files?
git lfs pull

Keywords

lfs

FAQs

Package last updated on 25 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts