Skip to content

Instantly share code, notes, and snippets.

View benjaminfuchs's full-sized avatar

Benjamin Fuchs benjaminfuchs

  • Freiburg, Germany
View GitHub Profile
@mmueller
mmueller / git
Last active July 6, 2022 18:12
This is a bash script that wraps git and lets you implement pre- or post-command hooks that apply to git globally (not per-repository). Out of the box, this script has a post_clone and post_init hook that do the same thing: prompt you to verify that the author information (user.name and user.email) are correct for the given repository -- prevent…
#!/bin/bash
#
# This script wraps git, so install it somewhere such as ~/bin where
# it will be found by your shell before the actual git executable.
set -e
# Extract the command from a git command line
function get_command {
while [[ "$1" =~ ^- ]]; do