• Stars
    star
    963
  • Rank 47,492 (Top 1.0 %)
  • Language
    Shell
  • License
    Other
  • Created over 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

βš“ A curated list of awesome git hooks

Awesome Git Hooks
Awesome Git Hooks

Awesome Lists PRs welcome

Awesome Git Hooks

βš“ Easy-to-use git hooks for automating tasks during git workflows.

Git hooks are custom scripts you can use to automate tasks which are triggered before or after a git command is executed. There are two groups of these hooks: client-side and server-side. Client-side hooks are triggered by operations such as committing and merging, while server-side hooks run on network operations such as receiving pushed commits. This repo contains helpful resources as well as a variety of git hook scripts that can be easily customized to serve different purposes.

βœ”οΈ Nothing to install/download

βœ”οΈ Code is well-documented

βœ”οΈ Grab & go! Copy the code you want to use and paste into your .git/hooks folder

Contributions are always welcome! Please see our Contribution Guidelines. Also, if you don't find the script you want below, you can create a new issue to request it.

Contents

Git Hook Scripts

Note: The icon next to each script signifies what language it is written in.

icon language
Bash Icon bash
Python Icon python
Perl Icon perl

commit-msg

  • enforce-insert-issue-number - Make sure user did not delete the ISSUE-[#] string that was generated by prepare-commit-msg/insert-issue-number.hook. Python Icon

post-checkout

  • delete-pyc-files - Delete all .pyc files every time a new branch is checked out. Python Icon
  • new-branch-alert - Display a message when a new branch is checked out for the first time. Bash Icon

post-update

  • update-server-info - Prepare a packed repository for use over dumb transports (e.g. http). Bash Icon

pre-commit

prepare-commit-msg

pre-push

  • prevent-bad-push - Prevent push of commits where the log message starts with "WIP" (work in progress). Bash Icon

pre-rebase

  • prevent-rebase - Prevent topic branches that are already merged to 'next' branch from getting rebased, because allowing it would result in rebasing already published history. Bash Icon

query-watchman

  • fsmonitor-watchman - Output to stdout all files that have been modified since a given time. Perl Icon

update

  • update - Block unannotated tags from entering. Bash Icon

Quick Start

  1. Pick a hook, any hook! Try the "verify-name-and-email" one if you're not sure where to start.
  2. Navigate to your project's hooks folder (.git/hooks).
  3. You should see a list of files already in there. Create a new file called the exact commit type that you want to use (eg: "commit-msg", "pre-rebase", "pre-commit", etc). Do not give it an extension.

create new file

  1. Open your new file and paste the code from the hook you chose out of this repo (eg: verify-name-and-email.hook).
  2. Save file. Done! Now the git hook will be triggered automatically.

Tools

  • Husky - Manage git hooks with a nice user interface.

  • Overcommit - A fully configurable and extendable git hook manager.

  • Git Build Hook Maven Plugin - Install Git hooks and config during a Maven build.

  • CaptainHook - Git hooks manager for PHP developers.

  • pre-commit - A framework for managing and maintaining multi-language pre-commit hooks.

Written Guides

Video Guides

License

CC0
This work is licensed under a Creative Commons Attribution 1.0 International License.

More Repositories

1

stardew-valley-daily-screenshot-mod

🐝 A Stardew Valley mod that automatically takes a screenshot of your entire farm at the start of each day
C#
10
star
2

uno

πŸƒ The card game Uno
JavaScript
9
star
3

awesome-webhooks

βš“ A curated list of awesome GitHub webhooks
JavaScript
5
star
4

web-clock-time-tracker

A webapp that makes time tracking simple for associates. Find out precisely what time to clock out at the end of each day to get the hours you need. Easily track time spent on any time codes, and view the weekly summary to easily see what information you need to submit at the end of the week.
JavaScript
4
star
5

hello-opengl-mvc-framework

The hello-opengl beginner program but using a Model-View-Controller (MVC) framework
C++
2
star
6

fedcodeathon

Website that helps entrepreneurs find the best location to start their business (won 3rd place at KC Federal Reserve Code-A-Thon 2019)
CSS
1
star
7

work-clock

πŸ• A CLI that lets user know what time they should clock out at work
JavaScript
1
star
8

circuit-maker

0️⃣ An online GUI for demonstrating binary logic gates
JavaScript
1
star
9

react-native-todo-list

A todo list made with React Native
JavaScript
1
star
10

opengl-two-smiley-faces

πŸ˜ƒ OpenGL project that displays two different versions of a smiley face
C++
1
star
11

hackathon-template-react-terra-prettier

Makes time tracking simple for hourly associates.
JavaScript
1
star
12

linux-x86-64-assembly-simple-examples

A collection of simple examples in Linux x86-64 Assembly.
Assembly
1
star
13

stardew-valley-server-finder-server

Server code for the Stardew Valley Server Finder project
JavaScript
1
star
14

push-pin-map-editor

Upload a map, add push pins to it, and export.
JavaScript
1
star