Skip to content

Instantly share code, notes, and snippets.

View hardenchant's full-sized avatar

Gleb Lysov hardenchant

View GitHub Profile
@hardenchant
hardenchant / pre-commit
Last active December 29, 2021 12:18 — forked from dreness/pre-commit
#git pre-commit #hook to set commit email address based on the repo's remote domain(s)
#!/bin/zsh
# source: https://gist.github.com/dreness/2de62e01d2053f9440eb
# Set repo's user.email to a default or alternate value based on remote domain.
# Because the in-flight commit info has already been set, if an email address
# change is needed, this commit is aborted. Retry the commit to use the new address.
#
# To automatically install custom hooks to new repos:
# 1) Add something like the following to ~/.gitconfig:
# [init]
# templatedir = ~/.git/templates