Ensure git status before running something like npm publish.
npm install ensure-git   
You always need to ensure that git working tree is clean and no conficts in your repo before publishing your package.
``bash`
yarn add ensure-git
`js
const ensureGit = require('ensure-git')
ensureGit()
.then(() => {
console.log('All good! you can now run npm publish ;)')
})
.catch(err => {
console.error(err.message)
process.exit(1)
})
`
#### options
##### cwd
Type: stringprocess.cwd()
Default:
The path to check.
##### anyBranch
Type: booleanundefined
Default:
By default if it's not on master branch the program will throw an error, use this option to disable the behavior.
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
ensure-git © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
> egoistian.com · GitHub @egoist · Twitter @rem_rin_rin