Giter VIP home page Giter VIP logo

git-commit-template's Introduction

git-commit-template

npm publish changelog

Sets commit template for your git projects. This is a husky plugin which should be used on prepare-commit-msg hook exposed by git.

When we do git commits we usually follow a practice for the commit message, this package aims to streamline that practice by providing you a standard template to follow. It also enables you to set your own standard template. With this plugin setup, next time when you do git commit you will get the standard template for commit message set for you.

Install

For installing this plugin you need husky >= 1.x. Use npm to install this plugin to your package:

npm i --save-dev git-commit-template husky@1

Note: We have tested the plugin with husky@1 but you can try with higher versions too if that works for you

It exposes a cli command with name git-commit-template which you can use in your husky configuration. For example:

// .huskyrc.js
module.exports = {
  hooks: {
    "prepare-commit-msg": "git-commit-template",
  },
};

git-commit-template command

This command takes an optional parameter of your commit message file name. If provided, then it will read the file provided by you, otherwise uses its default configuration file. Read .commit-msg file to see the default configuration added by us.

Sample for providing file name:

// .huskyrc.js
module.exports = {
  hooks: {
    "prepare-commit-msg": "git-commit-template .my-custom-git-msg-file",
  },
};

Note: This hooks provides you default commit message only if you haven't provided any yet. This means that this plugin will not add message if you are amending your commit(git commit --amend) or using interactive rebase (git rebase -i HEAD~3).

License

This library is licensed under the Apache 2.0 License.

git-commit-template's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-commit-template's Issues

Support for husky >=2

The current library has been tested with husky 1.x, update the library to support higher versions of husky.

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.