A simple node module to prevent commits to the master branch. Include in your pre-commit flow and profit.
npm install no-master-commitsA simple node module to prevent commits to the master branch. Include in your pre-commit flow and profit.
Popular (git work-flows)[https://www.atlassian.com/git/tutorials/comparing-workflows] prevent rewriting history
on the master branch and possibly others. To enforce this, no commits are allowed on such branches, only pull requests.
This lazy-developer, consistently made commits to local master branch,
and then suffered the consequences of having to reconcile the branches one too many times.
This module was born. The idea is to provide a simple CLI command that can be invoked in the precommit hook.
npm install no-master-commits
`Usage
To prevent commits to branches ['master', 'deploy']
`
// package.json
"scripts": {
"precommit": "no-master-commits -b master,deploy"
}
``The tests are run locally, and since the package is supposed to check
local checkouts in the first place, we'll leave it at that.