# husky

# Introduction

Husky is a tool that allows you to add Git hooks to your project. This allows you to run scripts before committing, pushing, etc. For example, you can use it to check if your code is formatted correctly before committing it. We use it to check if the commit message is formatted correctly based on the code consistency rules.

Commitlint is also installed with husky.

# Step 1: Initialize Git

To use husky you need to have a git repository initialized.

If you have already initiated git, then you don't need to do this. You will be informed at the beginning if you have already initialized Git.

If you have not yet initialized Git, you can do so with:

git init

# Step 2: Install husky

After initializing the git repository you can add husky to your project by running the following command:

rocket launchpad husky

Link to the husky documentation

# More information

Husky is used to verify that code consistency rules are followed before committing. For more information click here.

We create 1 hooks with husky:

  • commit-msg

# commit-msg

The commit-msg hook is used to check the commit message. If the commit message does not comply with the code consistency rules, the commit will be rejected.