Giter Site home page Giter Site logo

githooks's Introduction

Git Hooks

In this repo I'll collect custom git hooks that I use for my projects. Feel free to use them and contribute by creating a ticket or PR.

Git hook prepare-commit-msg

prepare-commit-msg is a hook that adds the issue number to the commit message.

It supports the following formats:

  • Jira tickets (PROJ-123):
    • feature/PROJ-123-description
    • PROJ-123
    • prefix-PROJ-123-description
    • prefix-PROJ-123
    • PROJ-123-description
  • Version (only three digits: 0.0.1, 123.23.23, 1.231.2, etc.):
    • v1.2.3
    • 1.1.1
    • myversion1.2.3withsometext
    • feature/v1.2.3-ewrfef
  • GitHub issues (123, 1, 34), the issue number MUST be at the start of the mssage:
    • 123
    • 123-description
    • feature/123-description

Contribution

Branch Name

Before you start the contribution, make sure that you are on the correct branch. Branch name should start from the issue number dash and short explanation with spaces replaced by underscores. Example:

  • OD-1-my_feature
  • OD-123-fix_bug
  • OD-2343452-my_important_pr

Commit Message Format

Commit message should start with the issue number with # like #123 or the issue id in brackets (if Jira or related project is used), like [PROJ-123].

To simplify the development process, use please githooks from .githooks directory. It will automatically add the issue number to the commit message. If you don't want to use the githooks, please add the issue number manually.

Commit message should describe the changes in present tense. Example: Add .gitignore file.

Git Hook

To configure the git hook, you need to simply run the command: git config core.hooksPath hooks

It will configure the git hook to run the pre-commit scripts. Source code of the hook is in hooks/prepare-commit-msg.

Commit Signing

All tags and commits MUST be signed with SSH (preferable) or GPG key. Read more About commit signature verification.

Pull Request

All features and bug fixes should be done in the separate branch and delivered to the main branch via the pull request. Pull request should be created from the branch with the same name as the issue number. Example: 1-my_feature.

githooks's People

Contributors

aohorodnyk avatar

Stargazers

 avatar  avatar

Watchers

 avatar

githooks's Issues

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.