Source: Git Hooks - Git
Git Hooks Integration for Chatie Projects
This module is a wrapper of the NPM module git-scripts, it provide following additional features:
pre-push
hook had been set to runnpm run lint
and thennpm version patch
beforegit push
for better code quality and version management.
Learn more about the original git-scripts
from its GitHub homepage: git-scripts
- Fail
- Success
Frist push:
git push -u origin branch
If you don't want to need to add the -u parameter every time, you can modify default settings for git.
git config --global push.default current
After that just use:
git push
You can skip git hook for pre-push
if you want.
To temporary disable the pre-push
git hook, you can set NO_HOOK=1
before do git push
:
# for Linux & Mac
NO_HOOK=1 git push
# for Windows
set NO_HOOK=1 git push
To permanent disable the pre-push
git hook, you can delete the related settings in package.json
:
- "git": {
- "scripts": {
- "pre-push": "npx git-scripts-pre-push"
- }
- }
In the v0.7 version, we have improved the user experience. Solve the problem of push blocking and improve the readability of output information. All projects using @chatie/scripts are highly recommended to upgrade.
Link to Issue #27
Update steps:
npm i -D @chatie/scripts@next
npx git-scripts install
- Enjoy push
- fix ts-node not found bug
- Improve readability of output messages
- Remove git tag
- Fix re-push produces meaningless version when push fails after
- Install hook to
package.json
automatically
- Wrap
git-scripts
Huan LI (李卓桓) [email protected]
- Code & Docs © 2019 - now Huan LI [email protected]
- Code released under the Apache-2.0 License
- Docs released under Creative Commons