EEMI

Guided Notes

Advanced Git & Best Practices

Hooks, CI/CD, submodules, signed commits, advanced remotes, and team best practices.

Git hooks

Slide 1 / 5

Hooks are scripts Git runs automatically at certain moments. They live in .git/hooks/:

• pre-commit — before a commit is created: run a linter or formatter, block debug code. • commit-msg — check the message format. • pre-push — run tests before pushing.

A hook that exits with a non-zero status cancels the action. Hooks aren't shared through clones, so teams use tools like Husky or pre-commit to install them for everyone.

← .gitignore, .gitattributes & LFS