Useful hooks in for your git pipeline
git clone https://github.com/jonyeezs/git-hooks.git
cp -R {dir-of-git-hooks}\{framework-specific-hook-folder-in-git-hooks}\* {dir-of-your-git-project}\.git\hooks\
or symlink it
ls -s {absolute-dirpath-of-git-hooks}\{framework-specific-hook-folder-in-git-hooks}\* {dir-of-your-git-project}\.git\hooks
cp {dir-of-git-hooks}\{framework-specific-hook-folder-in-git-hooks}\post-merge {dir-of-your-git-project}\.git\hooks\
or symlink it
ls -s {absolute-dirpath-of-git-hooks}\{framework-specific-hook-folder-in-git-hooks}\post-merge {dir-of-your-git-project}\.git\hooks\post-merge
- Save devs from forgetting to DoD their code before pushing to remote.
- The DOD:
- Do not leave debug code scattered.
- Make sure test passes every time new code is hacked
- Ensure housekeeping is done when possible. ie syncing package versions.
-
post-merge
- Only operate housekeeping where environmental state has changed between your local and remote
- Operations that you only need to do once during a merge, rebase, or a pull
-
pre-commit
- Code clean-ups, linting, etc.
- Low-fi operations that don't take too much processing
- You don't want a heavy process like running all your test that could take more than 2 seconds
- Commits should be done quick
-
pre-push
- Runs important process that would not make your commit unusable or broken
- Good where you need to run long processes
- Best time to run your test or notifications
-
runs test before pushing (FIXME: still bit buggy)
- work around ensure you build the project first before pushing
- Angular 2 and above for projects built with angular-cli
- mileage may vary for the commands and file regex used. Change it to suit your settings.