spekulatius/gitpolicy

Assists your developers and contributors with sensible git usage

0.1.4 2020-03-23 20:43 UTC

This package is auto-updated.

Last update: 2024-03-20 00:57:38 UTC


README

Build Status Latest Stable Version Latest Unstable Version Scrutinizer Code Quality Total Downloads License

GitPolicy helps you and your development team to follow guidelines for the usage of git. These guidelines can include several options, see features.

Beta state: This package is still in development. Please be careful and patient if you decide to use it.

Features

This is the set of features to make your life easier:

  • Define rules to achieve your desired git usage.

  • Forbidden actions (e.g. create new tag, push to master),

  • Expectations for names of git tags and branches are possible.

  • Support for common conventions like "begins with a ticket numbers" and semantic tags are possible.

  • Simple to configure and install: One command to do install and initial set up. Configuration over one file: .gitpolicy.yml

Requirements

This has been developed on a Debian destribution with Linux in mind. It should work on similar platforms. Mac OS: Maybe. Windows? No idea.

The only direct requirement is PHP 5.4.37.

Note: During the installation Composer will be installed and used to manage the dependencies of GitPolicy.

Installation

The installation and set up are combined into one single command for you to run. It will take all of the steps to install, configurature, re-initalize or update GitPolicy. This is how it works:

  1. Change into your project directory.

  2. Check and run the following command in your project folder:

    # install or update composer - we need this to manage the dependencies
    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer;
    
    # install the package as a global dependency and symlink it.
    composer global require spekulatius/gitpolicy;
    sudo ln -s ~/.composer/vendor/spekulatius/gitpolicy/gitpolicy /usr/local/bin/gitpolicy;
    
    # run the initial steps, this configures the git hook as well as copies the initial config file into your project.
    gitpolicy init;
    
    # commit the change
    git add composer.json composer.lock .gitpolicy.yml;
    git commit -m 'CHORE: Adding gitpolicy :sunny:'

Done 😎

Configuration

All configuration is done in one file: .gitpolicy.yml

With the initialization, an example is copied into your project :) All possible (sensible and non-sense) combinations of options have been listed. Please delete parts which aren't required for your project. By default there shouldn't be a strong policy in place.

Some .gitpolicy.yml examples:

More to come! If you want to share your .gitpolicy.yml as an example for a specific use case open a pull request ;)

Roadmap and ideas

Please see the issue tracker for planned enhancements and the roadmap.

License

For information regarding the license see license.md.