https://github.com/robertwang1001/check-git-clean
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
https://github.com/robertwang1001/check-git-clean
changes clean git nodejs repository status typescript uncommitted unstaged untracked
Last synced: 5 days ago
JSON representation
Check the cleanliness of a Git working directory, identifying untracked, unstaged, and uncommitted changes.
- Host: GitHub
- URL: https://github.com/robertwang1001/check-git-clean
- Owner: robertwang1001
- License: mit
- Created: 2024-08-12T13:48:31.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2026-05-12T10:01:00.000Z (6 days ago)
- Last Synced: 2026-05-12T19:32:42.174Z (6 days ago)
- Topics: changes, clean, git, nodejs, repository, status, typescript, uncommitted, unstaged, untracked
- Language: TypeScript
- Homepage:
- Size: 418 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
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!