Skip to content

Instantly share code, notes, and snippets.

@mfpiccolo
Created August 6, 2013 20:40
Show Gist options
  • Save mfpiccolo/6168419 to your computer and use it in GitHub Desktop.
Save mfpiccolo/6168419 to your computer and use it in GitHub Desktop.
Post Commit - Phil edit
#!/bin/sh
message=`git log -1 HEAD --format=format:%s`
branch=`git rev-parse --abbrev-ref HEAD`
data="`date`,${PWD##*/},${branch},${message}"
commit_log="~/commits/commits.csv"
echo $data >> $commit_log
echo "Added: $data to $commit_log"
# You must run both of these in each dir you want the script to run:
# git init
# chmod u+x .git/hooks/post-commit
# To run after gitx commit you have to open preferences and make sure that
# Git Executable: points to post-commit in ~/git_template/hooks/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment