https://github.com/r2-g2/githooks
[GH] my default Git hooks
https://github.com/r2-g2/githooks
git hooks post-commit templates
Last synced: 2 months ago
JSON representation
[GH] my default Git hooks
- Host: GitHub
- URL: https://github.com/r2-g2/githooks
- Owner: R2-G2
- License: mit
- Created: 2023-01-30T20:56:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T22:40:44.000Z (over 2 years ago)
- Last Synced: 2023-03-04T01:24:04.463Z (over 2 years ago)
- Topics: git, hooks, post-commit, templates
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# GitHooks: my default Git hooks
## Setup
### Universal
Create the *hooks templatedir*.
```shell
mkdir -p /CUSTOM/PATH/hooks
```Announce the *templatedir* to **Git**.
```shell
editor /PATH/TO/.gitconfig
``````gitconfig
[init]
templatedir = /CUSTOM/PATH
```### Personal
```shell
mkdir -p ~/.gittemplates/hooks
vim ~/.gitconfig
``````gitconfig
[init]
templatedir = ~/.gittemplates
```## Usage
### post-commit
First install **sl** (Steam Locomotive) and then create a symlink.
After committing, a steam locomotive will cross the terminal, trying to prevent you from pushing to early. **Spoiler:**
This won't always help!#### Universal
```shell
ln -s "$(readlink -m ./post-commit.sh)" /CUSTOM/PATH/hooks/post-commit
```#### Personal
```shell
ln -s "$(readlink -m ./post-commit.sh)" ~/.gittemplates/hooks/post-commit
```## Problems?
Fork! Fork it! Fork you! Fork me, right?