Skip to content

Instantly share code, notes, and snippets.

@archie
Created January 8, 2013 10:53
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 archie/4482874 to your computer and use it in GitHub Desktop.
Save archie/4482874 to your computer and use it in GitHub Desktop.
I found this somewhere online but I cannot remember where, so reposting here. Using the command line tool 'imagesnap' it grabs a photo every time you make a commit. It is activated through the post-commit hook. ➜ myrepo git:(master) cat .git/hooks/post-commit
#!/usr/bin/env ruby
file="~/.gitshots/#{Time.now.to_i}.jpg"
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__))
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file} &"
end
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment