git-mods
Check to ensure there are no unstaged changes in a git repo
Last updated 7 months ago by sramam .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install git-mods 
SYNC missed versions from official npm registry.

git-mods

npm license travis status Build status David David
NPM

A common pattern is to find errors during the commit/push process due to tests,git-hooks etc. Once changes are made, it's all too common to finish the original commit that leaves these changes behind.

git-mods automates this check. It provides a wrapper around git status and parses the output to enable

  1. git-mods: Checks to ensure there are no modifications in the current repo.
  2. git-mods --staged_ok: Checks to ensure no unstaged modifications exist. Staged modifications are acceptable.

Typically, git-mods --staged_ok is a good option to include in a precommit-hook and git-mods to include in the prepush-hook.

Installation & Usage

git-mods is best used along with husky, to easily add git-hooks to your repo. To make it's installation easier, husky uses a post install script to confgure any hooks specified. This results in a slightly convoluted installation sequence. If you didn't read-the-manual the first time, just npm install husky a second time

  • First, add precommit/prepush hooks to the scripts section of package.json In package.json:scripts:
...
"scripts": {
  "precommit": "git-mods --staged_ok",
  "prepush": "git-mods"
}
...
  • THEN, install the dependencies.
npm install git-mods husky --save-dev

Current Tags

  • 1.0.10                                ...           latest (7 months ago)

11 Versions

  • 1.0.10                                ...           7 months ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |