Skip to content

Instantly share code, notes, and snippets.

@dux
Last active August 29, 2015 14:04
Show Gist options
  • Save dux/06978cdb71c12fbd1ac8 to your computer and use it in GitHub Desktop.
Save dux/06978cdb71c12fbd1ac8 to your computer and use it in GitHub Desktop.
StashBuckets.com post commit hook wor Work Logs app
#!/usr/bin/ruby
# create .git/hooks/post-commit
# chmod +x .git/hooks/post-commit
# http://githooks.com/
# to test if it works just run ".git/hooks/post-commit" and it should post last git commit
require 'net/http'
require 'uri'
require 'colorize' # gem install colorize
msg = `git log -1 HEAD`
uri = URI('http://stashbuckets.com/buckets/ralpapoi/work_logs') # URL to your work log
res = Net::HTTP.post_form(uri, { 'commit'=>msg })
puts res.body.green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment