Skip to content

Instantly share code, notes, and snippets.

@pfichtner
Created December 2, 2018 10:32
Show Gist options
  • Select an option

  • Save pfichtner/a0743db56f3e1865b2c637dddd5e7123 to your computer and use it in GitHub Desktop.

Select an option

Save pfichtner/a0743db56f3e1865b2c637dddd5e7123 to your computer and use it in GitHub Desktop.
Checks out each commit and copies $COPY_ONLY of each revision to /tmp
#!/bin/sh
dir=$1
COPY_ONLY=target/surefire-reports
count=1
#git log $dir | grep ^commit | cut -d' ' -f2 | while read TAG; do
cd $dir && git branch -a --sort=committerdate | grep -v ' -> ' | while read TAG; do
echo $count $TAG
count=`expr $count + 1` && \
git clean -fd && \
git reset --hard $TAG && \
TARGET=/tmp/git-`printf '%04d' $count`
mkdir $TARGET && \
cp -ax $dir$COPY_ONLY $TARGET
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment