Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 2 KB

index.md

File metadata and controls

83 lines (55 loc) · 2 KB

Check your commits not only code.

Git history can be your source of truth. Same as with your code you need to take care of it. Codebase linting is common practice, but why neglect git history? How often you try to debug Error and git blame is not helpful because of the low-quality git message.

You can run gitector as part of your pre-commit check or CI pipeline.

Gitector allows you to define rules for your commit.

You can configure gitector in any way some of the possible features include:

  • Allow only commits with Ticket number
  • Allow contributions restricted to corporate e-mail
  • Disallow merges
  • Define maximum characters for the title
  • Encourage small commits by limiting the number of files in a single commit
  • Make sure commit starts with action verb describing changes (like add, remove, fix)

How to start

  • Init configuration inside your repo using gitector init
  • Edit .gitector.json to fit your
  • Run gitector to check your branch against defined rules

Examples (click on to view video)

Init gitector

asciicast

Compare all changes in your branch

asciicast

Use markdown formatter

asciicast

Usage

CLI

Init gitector configuration with default settings

gitector init

Run gitector against your local branch and master branch

Gitector ..master

Get more support

gitector —-help

Git hook

Edit file .git/COMMIT_EDITMSG and put inside

gitector -di

Github Actions

You can find latest version to add to your workflow here

Gitlab

Add code below to your .gitlab-ci.yml file

gitector:
  stage: build
  image: gitector/gitector
  script:
    - git fetch
    - gitector
  except:
    - master