Skip to content

Instantly share code, notes, and snippets.

@lmeyer
Created September 25, 2014 19:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmeyer/d51fe9b8e0b394916701 to your computer and use it in GitHub Desktop.
Save lmeyer/d51fe9b8e0b394916701 to your computer and use it in GitHub Desktop.
Gitshots for Windows - Gitcam
#!/bin/sh
### gitcam for windows (start) ###
NAME=`date +%Y%m%d%H%M%S`
DIRECTORY="/IMAGES/TARGET/DIRECTORY"
COMMANDCAMDIR="/PATH/TO/COMMANDCAM"
BMP2JPGDIR="/PATH/TO/BMP2PG"
if [ ! -d "$DIRECTORY" ]; then
mkdir $DIRECTORY
fi
$COMMANDCAMDIR/CommandCam //quiet //filename $DIRECTORY/$NAME.bmp
$BMP2JPGDIR/BMP2JPG.exe "$DIRECTORY/$NAME.bmp" "$DIRECTORY/$NAME.jpg" > /dev/null
rm $DIRECTORY/$NAME.bmp
### gitcam for windows (end) ###

Instructions

  1. Download gitcam.sh
  2. Download CommandCam : http://batchloaf.wordpress.com/commandcam/
  3. Download BMP2JPG : http://www.microtom.net/os-management/convert-bmp-to-jpg-command-line-utility
  4. Install this as a post-commit hook in your repo
  5. git config --global init.templatedir '~/.git_template'
  6. mkdir -p ~/.git_template/hooks
  7. echo -e '#!/bin/sh\n/PATH/TO/gitcam.sh' >> ~/.git_template/hooks/post-commit
  8. chmod +x ~/.git_template/hooks/post-commit
  9. Run git init in a repo where you want to use the hook!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment