check-git-clean
v2.0.1
Published
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes
Maintainers
Readme
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
Install
Using pnpm:
pnpm add check-git-cleanUsing yarn:
yarn add check-git-cleanUsing npm:
npm install check-git-cleanUsage
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()Contributing
Contributions are welcome! If you have ideas, bug fixes, or improvements, please open an issue or submit a pull request on the GitHub repository.
Give a ⭐️ if this project helped you!
License
This project is licensed under the MIT License. See the LICENSE file for more details.
