GitHooksVS is a Visual Studio extension for managing Git hooks and custom scripts in your repository. It provides a user-friendly interface to enable, disable, and organize scripts for each supported Git hook type.
-
.githooks Folder Structure
In the root of your Git repository, create a folder named.githooks:- .githooks
- pre_merge
- 01_script_name
- 02_script_name
- pre_merge
- .githooks
-
Each subfolder corresponds to a supported Git hook type.
-
Place your shell scripts (starting with
#!/bin/sh) in the appropriate subfolder. -
Automatic Git Hook Script Generation
The extension will automatically create or update the actual Git hook scripts in.git/hooks/to call the enabled scripts from.githooks. -
Configuration File
A config file is generated to track which scripts are enabled/disabled.
Add this config file to your.gitignoreas it is intended for local use only.
-
On Visual Studio Startup / Solution Open:
The extension checks for new scripts in.githooksand prompts you to enable them. -
Manual Management:
UseTools > Manage Git Hooksin Visual Studio to open the management window and enable/disable scripts at any time.
pre-commitpost-checkoutpost-merge
More hook types will be added in the future.
Pull requests are welcome if you want to add support for additional hooks!
MIT License (or your preferred license)