Skip to content

Commit a6f41ec

Browse files
docs: add instructions for removing commit hooks (#2218)
This adds documentation on how to remove the git hooks set up via Vite+. [Context](https://x.com/TheAlexLichter/status/2079986649396601061)
1 parent cd064c6 commit a6f41ec

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

docs/guide/commit-hooks.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,23 @@ export default defineConfig({
5858
```
5959

6060
This is the default Vite+ approach and should replace separate `lint-staged` configuration in most projects. Because `vp staged` reads from `vite.config.ts`, your staged-file checks stay in the same place as your lint, format, test, build, and task-runner config.
61+
62+
## Removing commit hooks
63+
64+
To fully remove Vite+ commit hooks, undo each thing `vp config` set up:
65+
66+
1. Unset the Git hooks path that points at the Vite+ dispatcher:
67+
68+
```bash
69+
git config --unset core.hooksPath
70+
```
71+
72+
2. Remove the hooks directory (use your `--hooks-dir` value if you changed it):
73+
74+
```bash
75+
rm -rf .vite-hooks
76+
```
77+
78+
3. Remove `vp config` from the `prepare` script in `package.json`. Otherwise the next install re-runs `vp config` and reinstalls the hooks.
79+
80+
4. Remove the `staged` block from `vite.config.ts` if it exists

0 commit comments

Comments
 (0)