https://github.com/jpeer264/node-is-git-dirty
Check if a repository has untracked, modified or added files
https://github.com/jpeer264/node-is-git-dirty
dirty git head is-git modified repo repository untracked
Last synced: 25 days ago
JSON representation
Check if a repository has untracked, modified or added files
- Host: GitHub
- URL: https://github.com/jpeer264/node-is-git-dirty
- Owner: JPeer264
- License: mit
- Created: 2018-04-22T17:07:38.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T14:02:33.000Z (about 2 years ago)
- Last Synced: 2025-04-09T16:07:37.939Z (28 days ago)
- Topics: dirty, git, head, is-git, modified, repo, repository, untracked
- Language: TypeScript
- Homepage:
- Size: 1.29 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is-git-dirty
[](https://travis-ci.com/JPeer264/node-is-git-dirty)
[](https://ci.appveyor.com/project/JPeer264/node-is-git-dirty)
[](https://coveralls.io/github/JPeer264/node-is-git-dirty?branch=main)Checks synchronously if the git repository is clean. This assumes that no files are added, untracked or modified.
## Installation
```sh
$ npm i is-git-dirty --save
```
or
```sh
$ yarn add is-git-dirty
```## Usage
Returns:
- `null`: Directory is not a git repository
- `true`: Files are added, untracked or modified
- `false`: No files are added, untracked or modified. Git is clean```js
import isGitDirty from 'is-git-dirty';isGitDirty(); // true or false of process.cwd()
isGitDirty('any/git/repo'); // true or false
```## LICENSE
MIT © [Jan Peer Stöcklmair](https://www.jpeer.at)