Skip to content

Instantly share code, notes, and snippets.

@tobyontour
Created July 3, 2015 16:27
Show Gist options
  • Select an option

  • Save tobyontour/9ccd050c87c7a362a822 to your computer and use it in GitHub Desktop.

Select an option

Save tobyontour/9ccd050c87c7a362a822 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Put in .git/hooks/post-checkout
# Makes doing timesheets a little easier. :-)
# --- Command line
oldrev="$1"
newrev="$2"
changed_branch="$3"
if [ $changed_branch -eq "1" ]
then
if branch=$(git symbolic-ref -q HEAD)
then
echo "`date` Changed to $branch" >>~/checkout.log
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment