https://github.com/glorywong/check-git-clean
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
https://github.com/glorywong/check-git-clean
changes clean git nodejs repository status typescript uncommitted unstaged untracked
Last synced: 9 months ago
JSON representation
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
- Host: GitHub
- URL: https://github.com/glorywong/check-git-clean
- Owner: GloryWong
- License: mit
- Created: 2024-08-12T13:48:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-06T21:41:09.000Z (9 months ago)
- Last Synced: 2025-04-06T22:26:44.536Z (9 months ago)
- Topics: changes, clean, git, nodejs, repository, status, typescript, uncommitted, unstaged, untracked
- Language: TypeScript
- Homepage:
- Size: 263 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README













# check-git-clean
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
## Install
Using pnpm:
```bash
pnpm add check-git-clean
```
Using yarn:
```bash
yarn add check-git-clean
```
Using npm:
```bash
npm install check-git-clean
```
## Usage
```javascript
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()
```
## Authors
👤 **GloryWong**
* Website: https://glorywong.com
* GitHub: [@GloryWong](https://github.com/GloryWong)
## Show Your Support
Give a ⭐️ if this project helped you!