Giter Site home page Giter Site logo

githooks's Introduction

GitHooks

Some hooks that could be interesting

commit-msg

Git commit-msg hook. If your branch name is following Jira like convention in the form "ABCD-123-whatever", or "ABCD-123_whatever", it automatically adds the prefix "ABCD-123" to commit messages.

Usage

#noref

If you include "#noref" in the commit message, nothing will be added to the commit message, and the "#noref" itself will be stripped.

Use it as PREFIX or SUFFIX

If you want to write the branch id before the commit message, set the variable WRITE_BRANCH_ID_AS_PREFIX to true --> ABCD-123 My commit message

If you want to write the branch id before the commit message, set the variable WRITE_BRANCH_ID_AS_PREFIX to false --> My commit message ABCD-123

Installation

Just copy the hook, in the hooks folder for the git repositories you want to use it.

Or just use this command.

cp commit-msg your_project/.git/hooks

Logging:

You can enable the logs to trace it, in case something is wrong. Just set to true the LOG_ENABLED constant.

Testing:

git init a new repo, install the commit hook, and run: ruby .git/hooks/commit-msg testing

githooks's People

Contributors

sirmartin avatar

Watchers

James Cloos avatar  avatar

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.