Skip to content

Instantly share code, notes, and snippets.

@cworks
Created December 22, 2015 04:31
Show Gist options
  • Save cworks/0a7a5fef682689333dab to your computer and use it in GitHub Desktop.
Save cworks/0a7a5fef682689333dab to your computer and use it in GitHub Desktop.
#!/bin/bash
# zip all commits between an earlier commit and a later commit
# $1 earlier commit
# $2 later commit
# $3 name of zip archive
IFS=$'\n'
files=($(git diff --name-only $1 $2))
git archive -o $3 $2 "${files[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment