Skip to content

Instantly share code, notes, and snippets.

@arq5x
Created March 21, 2012 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arq5x/2143160 to your computer and use it in GitHub Desktop.
Save arq5x/2143160 to your computer and use it in GitHub Desktop.
ka-ching your git commit
# Note, these instructions assume OS X.
# Alternatives to the afplay command likely exist on
# other POSIX systems. Google is your friend.
# NOTE: Obviously, you can put the MP3 file where ever you so desire.
# 1. Make a new directory called "ka-ching" under /usr/share/
sudo mkdir /usr/share/ka-ching
# 2. Download the ka-ching.mp3 from my Dropbox site
sudo curl -s http://dl.dropbox.com/u/515640/ka-ching/ka-ching.mp3 > /usr/share/ka-ching/
# 3. Now, create your client side git-commit "hook". This assumes you are in the directory
# housing your git repository.
cp .git/hooks/post-commit.sample .git/hooks/post-commit
# 4. Edit .git/hooks/post-commit to look like this:
cat .git/hooks/post-commit
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
afplay /usr/share/ka-ching/ka-ching.mp3
# Now, after your next commit in this repository, \
# you should hear the temporarily (for maybe 3 times, maximum) \
# pleasing ka-ching sound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment