1.0.0 • Published 2 years ago

git-hey v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

GIT-HEY

Notify your team about important changes in your project using git commits.

Installation

  1. Install git-hey as a dev dependency:

    # With NPM:
    npm install git-hey -D
    
    # With Yarn:
    yarn add git-hey -D
    
    # With pnpm
    pnpm add git-hey -D
  2. Install husky as a dev dependency and enable git hooks:

    # With NPM:
    npm install husky -D && npx husky install
    
    # With Yarn:
    yarn add husky -D && yarn husky install
    
    # With pnpm
    pnpm add husky -D && pnpm husky install

    Read more about husky installation here.

  3. To automatically have git hooks enabled after install, add prepare script into your package.json:

    {
      "scripts": {
        "prepare": "husky install"
      }
    }
  4. Create git hooks:

    # With NPM:
    npx husky add .husky/post-checkout "git-hey hook checkout $1 $2"
    npx husky add .husky/post-merge "git-hey hook merge"
    npx husky add .husky/post-rewrite "git-hey hook rewrite"
    
    # With Yarn:
    yarn husky add .husky/post-checkout "git-hey hook checkout $1 $2"
    yarn husky add .husky/post-merge "git-hey hook merge"
    yarn husky add .husky/post-rewrite "git-hey hook rewrite"
    
    # With pnpm
    pnpm husky add .husky/post-checkout "git-hey hook checkout $1 $2"
    pnpm husky add .husky/post-merge "git-hey hook merge"
    pnpm husky add .husky/post-rewrite "git-hey hook rewrite"

    Read more about creating a hook with husky here.

  5. Commit changes.

Usage

Add a paragraph to your commit message starting with NOTIFY: and anything that follows will be displayed when somebody pulls changes with that commit or switches from a branch that does not have that commit to one that does.

For example:

chore: deps bump

NOTIFY: DEPENDENCY UPDATE
Our dependencies have been updated,
please run `pnpm install` to update them.

Closes #1

will be displayed as:

example

Syntax

Every commit message that contains one or more following paragraphs:

<prefix>: <title_or_description>
[description]

will be shown as a notification.

A description field is not required, but when is provided, the line which contains prefix will be displayed as a title, and anything that follows will be displayed as a description.

CLI

Commands

CommandArgumentsDescription
helpDisplays complete help.
hook<hook>Displays possible notifications, when is git hook invoked.

Options

OptionAliasDefault valueDescription
--prefix-pNOTIFYPrefix to look for in commit messages.
--view-wboxChange view at which notifications are displayed.
--color-ccyanChange notification border color.

Styling description

You can indicate emphasis with bold, italic, or strikethrough text in your notification description.

StyleSyntaxExampleOutput
Bold** ** or __ __**This is bold text**This is bold text
Italic_ _ or * *_This is italic text_This is italic text
Strikethrough~~ ~~~~This is strikethrough text~~This is strikethrough text
Bold and italic*** *** or ___ ___***This is important text*****This is important text**

You can also call out code or a command within a sentence with single backticks, and will be highlighted, e.g.:

Please run `pnpm install`.