An open API service indexing awesome lists of open source software.

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

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?