---
title: Testing GIT Hooks Before Actually Committing
description: If you want to use GIT hooks (pre-commit, pre-push), but want to test them before actually committing, it's really easy to do.
date: 2020-07-01
tags: GIT, GIT Hooks
source: https://brianchildress.co/blog/test-git-hooks-before-committing
---

# Testing GIT Hooks Before Actually Committing

If you're using GIT hooks and want to be able to test them without adding cruft to your GIT repository, you can easily test individual hooks anytime. GIT hooks are, by default, executable files that can be run through a simple bash command.

_From your repository_
```sh
$ bash .git/hooks/pre-commit
```

This will execute the GIT hook and provide quick feedback without adding additional "testing" commits to your repo.

If you're interested in getting GIT hooks setup for your JavaScript project, here's a post on getting started: [Save Yourself from Yourself](https://brianchildress.co/pre-commit-hooks/).
