Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Created September 19, 2018 15:12
Show Gist options
  • Save GeoffWilliams/21de190c5f6285b68f777885d92dba72 to your computer and use it in GitHub Desktop.
Save GeoffWilliams/21de190c5f6285b68f777885d92dba72 to your computer and use it in GitHub Desktop.
get all revisions from a file from git and copy to directory
REFS=$(git log Gemfile | grep commit | awk '{print $2}')
for REF in $REFS ; do
git checkout $REF Gemfile
mkdir -p gemfiles/$REF
cp Gemfile gemfiles/$REF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment