Skip to content

Instantly share code, notes, and snippets.

View Irfan434's full-sized avatar

Irfan Ahmad Irfan434

View GitHub Profile
@Irfan434
Irfan434 / post-checkout.sh
Created February 27, 2020 00:53
Git hook for logging branch checkouts
# Instructions
# ========================================================================
# 1. Copy this file to .git/hooks/post-checkout (remove the .sh extension)
#
# 2. Set the destination for the logs, e.g.
# - export CHECKOUT_LOG='~/checkout.log'
# - also add it as a Windows environment variable with the full filepath
#
# 3. Watch the logs update every time you checkout a branch with
# tail -f $CHECKOUT_LOG