Package detail

is-git-dirty

JPeer2641.1mMIT2.0.2

Check if a repository has untracked or added files

is, git, clean, dirty

readme

is-git-dirty

Build Status Build status Coverage Status

Checks synchronously if the git repository is clean. This assumes that no files are added, untracked or modified.

Installation

$ npm i is-git-dirty --save

or

$ 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
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

changelog

2.0.2 - March, 03 2023

  • 755595b Docs: use import in the readme (JPeer264)
  • 18cdc0a Chore: change variable name of the default export (closes #22) (JPeer264)

2.0.1 - July, 23 2020

  • 5ac179d Chore: remove tests from npm package (JPeer264)

2.0.0 - July, 23 2020

  • c9f072c Docs: master -> main (JPeer264)
  • cb4d528 Feat: update dependencies | TS support | drop node lower v10 (JPeer264)
  • 9fbd135 Chore: update husky hook (JPeer264)
  • 6e92978 Test: add correct coverage (JPeer264)

1.0.0 - April, 22 2018

  • 6f475da Refactor: is-git-clean to is-git-dirty (JPeer264)