Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
Using pnpm:
pnpm add check-git-clean
Using yarn:
yarn add check-git-clean
Using npm:
npm install check-git-clean
import { checkGitClean } from 'check-git-clean'
/**
* Check if a local git repository is clean.
* Ignore files defined in [git-ignore-patterns](git-ignore-patterns),
* which contains commonly git-ignored files for node project.
* @param dir (optional). Default to `process.cwd()`
* @return Object { `isClean`, `untracked`, `unstaged`, `uncommitted` }
*/
const { isClean, untracked, unstaged, uncommitted } = await checkGitClean()
👤 GloryWong
- Website: https://glorywong.com
- GitHub: @GloryWong
Give a ⭐️ if this project helped you!