https://github.com/scipopt/localhooks
https://github.com/scipopt/localhooks
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/scipopt/localhooks
- Owner: scipopt
- Created: 2021-04-30T08:56:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T12:01:18.000Z (over 1 year ago)
- Last Synced: 2025-01-28T00:35:15.525Z (over 1 year ago)
- Language: Shell
- Size: 30.3 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Localhooks for scip
----------
These git hooks help to check the correct format of commits before pushing.
They need to be installed by the user for the local repository.
For instructions please continue reading.
Available hooks:
----------------
- commit-msg: checks every commit message for correct format (line length, etc.)
- pre-commit: checks every commit for trailing whitespaces, filename format and that the files size does not exceed 50 MB
Instructions for local hooks
-----------------
Hooks are scripts that run before or after certain events
in Git. The `commit-msg` hook for example runs after the
commit message is edited and checks for the correct format.
For security reasons, local hooks have to be activated
manually for every single repository.
There are several ways of doing that:
1. Run `installhooks` and follow the steps
(this method will create links to the hooks just like method 2)
2. Create links from
`.git/hooks/`
in every repository to the scripts in this localhooks/ folder you like to use.
example:
```
cd scip/.git/hooks
ln -s /path/to/localhooks/commit-msg
```
3. Copy the contained hooks into the directory
`.git/hooks/`
of your local repository.