Code Monkey home page Code Monkey logo

git-scripts's Introduction

@chatie/git-scripts

NPM Version npm (tag) Build Status

Git Hooks

Source: Git Hooks - Git

Git Hooks Integration for Chatie Projects

USAGE

This module is a wrapper of the NPM module git-scripts, it provide following additional features:

  1. pre-push hook had been set to run npm run lint and then npm version patch before git push for better code quality and version management.

Learn more about the original git-scripts from its GitHub homepage: git-scripts

Preview

  • Fail

image

  • Success

image

Use

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

DISABLE THE HOOK

You can skip git hook for pre-push if you want.

1. Temporary

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

2. Permanent

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"
-    }
-  }

Upgrade from old version

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

Upgrade guide

Update steps:

  1. npm i -D @chatie/scripts@next
  2. npx git-scripts install
  3. Enjoy push

CHANGELOG

master

v0.7.8 (12 Apr 2022 )

  1. fix ts-node not found bug

v0.7.6 (12 Apr 2022 )

  1. Improve readability of output messages

v0.7.4 (10 Apr 2022 )

  1. Remove git tag

v0.7 (08 Apr 2022 )

  1. Fix re-push produces meaningless version when push fails after

v0.2 (10 Jun 2019)

  1. Install hook to package.json automatically

v0.0.1 (08 Jun 2019)

  1. Wrap git-scripts

AUTHOR

Huan LI (李卓桓) [email protected]

Profile of Huan LI (李卓桓) on StackOverflow

COPYRIGHT & LICENSE

  • Code & Docs © 2019 - now Huan LI [email protected]
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.