git-hey v1.0.0
GIT-HEY
Notify your team about important changes in your project using git commits.
Installation
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
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.
To automatically have git hooks enabled after install, add
prepare
script into yourpackage.json
:{ "scripts": { "prepare": "husky install" } }
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.
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:
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
Command | Arguments | Description |
---|---|---|
help | Displays complete help. | |
hook | <hook> | Displays possible notifications, when is git hook invoked. |
Options
Option | Alias | Default value | Description |
---|---|---|---|
--prefix | -p | NOTIFY | Prefix to look for in commit messages. |
--view | -w | box | Change view at which notifications are displayed. |
--color | -c | cyan | Change notification border color. |
Styling description
You can indicate emphasis with bold, italic, or strikethrough text in your notification description.
Style | Syntax | Example | Output |
---|---|---|---|
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~~ | |
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`.
2 years ago