<commit_before>About git-hooks
=======

A tool to manage project, user, and global Git hooks for multiple git repositories.

It allows hooks to be installed inside git repositories, users home directory, and globally.  
When a hook is called by `git`, git-hooks will check each of these locations for the hooks to run.


Install (Linux)
=======

To install from a local copy execute the `local_install.sh` script.

To install directly from the github repo, execute the following commands:

```
wget https://raw.githubusercontent.com/SDW-CC/git-hooks/master/remote_install.sh
chmod +x remote_install.sh
./remote_install.sh
source ~/.bash_profile

```


Install (Windows)
=======

To install from a local copy execute the `win_local_install.bat` script.

To install directly from the github repo, execute the following commands:

```
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/SDW-CC/git-hooks/master/win_remote_install.bat', 'win_remote_install.bat') }"
win_remote_install.bat

```

After instalation add the `%USERPROFILE%\.git_hooks` folder to the PATH.


Uninstall 
=======

**Linux:** execute the `uninstall.sh` script and remove the instalation folder from the PATH inside the `~/.bash_profile` file.

**Windows:** execute the `win_uninstall.bat` script and remove the instalation folder from the PATH.


Usage
=======

Run `git hooks --install` in a git project tell it to use git-hooks hooks.  You can run `git hooks --uninstall` at any time to revert to your previous hooks.  (These are usually the default hooks, which do nothing.)

Run `git hooks --installglobal` to force any new git repository or any git repository you clone to have a reminder to install git hooks. (It can't be on by default for security reasons.)


Overview
========

Hooks are powerful and useful.  Some common hooks include:

- Verify that the commit message has a certain length.
- Spell check the commit message.
- Verify that the code builds.
- Verify that any new files contain a copyright with the current year in it.

Hooks can be very project-specific such as:<commit_msg>Readme updated for windows<commit_after>About git-hooks
=======

A tool to manage project, user, and global Git hooks for multiple git repositories.

It allows hooks to be installed inside git repositories, users home directory, and globally.  
When a hook is called by `git`, git-hooks will check each of these locations for the hooks to run.


Install (Linux)
=======

To install from a local copy execute the `local_install.sh` script.

To install directly from the github repo, execute the following commands:

```
wget https://raw.githubusercontent.com/SDW-CC/git-hooks/master/remote_install.sh
chmod +x remote_install.sh
./remote_install.sh
source ~/.bash_profile

```


Install (Windows)
=======

To install from a local copy execute the `win_local_install.bat` script.

To install directly from the github repo, execute the following commands:

```
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/SDW-CC/git-hooks/master/win_remote_install.bat', 'win_remote_install.bat') }"
win_remote_install.bat

```

After instalation add the `%USERPROFILE%\.git_hooks` folder to the PATH.


Uninstall 
=======

**Linux:** execute the `uninstall.sh` script and remove the instalation folder from the PATH inside the `~/.bash_profile` file.

**Windows:** execute the `win_uninstall.bat` script and remove the instalation folder from the PATH.


Usage
=======

**Linux:**

Run `git-hooks --install` in a git project tell it to use git-hooks hooks.  
You can run `git-hooks --uninstall` at any time to revert to your previous hooks.  (These are usually the default hooks, which do nothing.)
Run `git-hooks --installglobal` to force any new git repository or any git repository you clone to have a reminder to install git hooks. (It can't be on by default for security reasons.)

**Windows:**

Same as above, except you have to run everything with 'git-hooks.sh' instead of 'git-hooks'.


Overview
========

Hooks are powerful and useful.  Some common hooks include:

- Verify that the commit message has a certain length.
- Spell check the commit message.
- Verify that the code builds.
- Verify that any new files contain a copyright with the current year in it.

Hooks can be very project-specific such as:
{'fraction_non_alphanumeric': 0.09837565774422329, 'fraction_numerical': 0.0, 'mean_word_length': 4.3512851897184825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '156704', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1215, 'n_words': 557}