Skip to content

Super slow on windows (> 30 secs Backing up original state...) #1595

@zhuhang-jasper

Description

@zhuhang-jasper

Context

  • Terminal or GUI client (TortoiseGit)
  • Windows 11
  • Node: v14, v16, v20, v22 (using NVM on windows)

Issue

  • Each time I perform a commit, it takes more than 30 seconds at the step "Backing up original state...".
  • If i immediately perform consecutive commits within a short timeframe, it is faster. But after awhile (say few minutes), it will will again be slow.
  • Note: It is faster if there are no files to be linted.

Hook

// .husky/pre-commit
npm run pre-commit

// package.json
"scripts": {
  "prepare": "husky",
  "pre-commit": "lint-staged",
  ...

// .lintstagedrc
module.exports = {
  "*.{cjs,js,jsx,css,scss,json}": "prettier --write",
  "*.{cjs,js,jsx}": "eslint --fix",
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions