Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 25, 2024
1 parent 9241f8a commit 8a5dfa2
Show file tree
Hide file tree
Showing 12 changed files with 1,880 additions and 1,142 deletions.
8 changes: 4 additions & 4 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default defineConfig({
},
sidebar: [
{ text: 'Introduction', link: '/' },
{ text: 'Getting started', link: '/getting-started' },
{ text: 'Recipes', link: '/recipes' },
{ text: 'Troubleshooting', link: '/troubleshooting' },
{ text: 'Migrating from v4', link: '/migrating-from-v4' },
{ text: 'Get Started', link: '/get-started' },
{ text: 'How To', link: '/how-to' },
{ text: 'Troubleshoot', link: '/troubleshoot' },
{ text: 'Migrate from v4', link: '/migrate-from-v4' },
],
}
})
63 changes: 63 additions & 0 deletions docs/get-started.md
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._

139 changes: 0 additions & 139 deletions docs/getting-started.md

This file was deleted.

0 comments on commit 8a5dfa2

Please sign in to comment.