-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,880 additions
and
1,142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Get started | ||
|
||
## Install | ||
|
||
::: code-group | ||
|
||
```shell [npm] | ||
npm install --save-dev husky | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm add --save-dev husky | ||
``` | ||
|
||
```shell [yarn] | ||
yarn add --dev husky | ||
# Add pinst ONLY if your package is not private | ||
yarn add --dev pinst | ||
``` | ||
|
||
```shell [bun] | ||
bun add --dev husky | ||
``` | ||
|
||
::: | ||
|
||
## `husky init` (recommended) | ||
|
||
The `init` command simplifies setting up husky in a project. It creates a `pre-commit` script in `.husky/` and updates the `prepare` script in `package.json`. Modifications can be made later to suit your workflow. | ||
|
||
::: code-group | ||
|
||
```shell [npm] | ||
npx husky init | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm exec husky init | ||
``` | ||
|
||
```shell [yarn] | ||
# Due to specific caveats and differences with other package managers, | ||
# refer to the How To section. | ||
``` | ||
|
||
```shell [bun] | ||
bunx husky init | ||
``` | ||
|
||
::: | ||
|
||
|
||
## Try it | ||
|
||
Congratulations! You've successfully set up your first Git hook with just one command 🎉. Let's test it: | ||
|
||
```shell | ||
git commit -m "Keep calm and commit" | ||
# test script will run every time you commit | ||
``` | ||
|
||
_For manual setup and more information, see the [How To](how-to) section._ | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.