Better Living Through 

by Leta Keane @LetaCodes

 Git Hooks

LAND

ACKN

OWLE

DGEM

ENT

@LetaCodes

@LetaCodes

@LetaCodes

@LetaCodes

git hooks can

run your tests

standardize commit messages

clean up your workflow, you slobs

(No waiting for your build!)

Lint Your Code

and more

@LetaCodes

pre-commit

automated commit msg

prepare-commit-msg

commit msg made

commit-msg
post-commit

commit lifecycle

@LetaCodes

const add2 = number => number + 2;
const add3 = number => number + 3;

module.exports = { add2, add3 };
const addNum = num => {
  const add = number => number + num;

  return add;
}

const add2 = addNum(2);
const add3 = addNum(3);

module.exports = { add2, add3 };

Before

After

(this code doesn't

really matter)

@LetaCodes

@LetaCodes

#!/bin/sh

echo "\Running tests:\n"

npm run test

@LetaCodes

when things are dandy

@LetaCodes

when things are not dandy

@LetaCodes

Be a good person.

use git hooks.

@LetaCodes

that person from the thing .com

LetaKeane.com

leta@turing.io

@LetaCodes

Better Living Through Git Hooks

By letakeane

Better Living Through Git Hooks

Tired of inconsistent commit messages? Find yourself forgetting to run your test suites before you commit a change? Do you have to push extra commits to remove comments? This talk will show you how to make use of git hooks to automate your git workflow and ensure consistency, clean commits, and your own peace of mind.

  • 1,029