Skip to content

Instantly share code, notes, and snippets.

@Geri-Borbas
Created July 12, 2013 15:18
Show Gist options
  • Save Geri-Borbas/5985252 to your computer and use it in GitHub Desktop.
Save Geri-Borbas/5985252 to your computer and use it in GitHub Desktop.
#!/bin/sh
#Usage: export_snapshots 'eppz!alert/EPPZAlert.m'
DESTINATION_PATH='Snapshots'
FILE_PATH=$1
FILE_NAME=$(basename $FILE_PATH)
echo 'Exporting <'$FILE_NAME'> located in <'$FILE_PATH'> to <'$DESTINATION_PATH'>.'
mkdir $DESTINATION_PATH
for COMMIT in $(git log --oneline $FILEPATH | cut -f 1 -d " "); do
git checkout $COMMIT $FILE_PATH
cp $FILE_PATH snapshots/$COMMIT'_'$FILE_NAME
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment