Coder Social home page Coder Social logo

git-hooks's Introduction

Useful scripts for Git Hooks

Build Status

prepare-commit-msg

  • ticket_number.sh - this script adds ticket number to commits in feature branch. It gets ticket number from branch name. Branch name should have following format EXAMPLE-305/some_feature.

    For example if first commit is named Implements some feature this script will update it with ticket number and it will look like EXAMPLE-305 Implements some feature.

    Also you can set EACH_COMMIT variable to false if you want add ticket number only for the first commit.

    Symlink: ln -s ~/tools/git-hooks/src/prepare-commit-msg/ticket_number.sh .git/hooks/prepare-commit-msg

pre-commit

  • php_cs_fixer.sh - this script runs PHP-CS-Fixer before commit for fixing code style.

    Symlink: ln -s ~/tools/git-hooks/src/pre-commit/php_cs_fixer.sh .git/hooks/pre-commit

  • phpunit.sh - this script runs PHPUnit before commit for running tests.

    Symlink: ln -s ~/tools/git-hooks/src/pre-commit/phpunit.sh .git/hooks/pre-commit

  • check_working_on_master.sh - this script helps to warn if you make commit on the master branch.

    Symlink: ln -s ~/tools/git-hooks/src/pre-commit/check_working_on_master.sh .git/hooks/pre-commit

post-merge

  • composer_install.sh - this script installs composer packages specified in composer.json or composer.lock (if it presents) file after git pull or git merge.

    Symlink: ln -s ~/tools/git-hooks/src/post-merge/composer_install.sh .git/hooks/post-merge

Installation

  1. Pull this repo to some place in your machine

    $ git clone https://github.com/greeflas/git-hooks.git

  2. Create a symlink for needed script in your project .git/hooks directory

    $ ln -s ~/tools/git-hooks/src/prepare-commit-msg/ticket_number.sh .git/hooks/prepare-commit-msg

Contributing

For information about contributing please read CONTRIBUTING.md.

License

license

This project is released under the terms of the BSD-3-Clause license.

Copyright (c) 2019 - 2024, Volodymyr Kupriienko

git-hooks's People

Contributors

greeflas avatar maxim-kravets avatar yashuk803 avatar

Stargazers

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

Watchers

 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.