Skip to content

Instantly share code, notes, and snippets.

@technolize
Created August 17, 2015 13:13
Show Gist options
  • Save technolize/39735e5c89e2ad8bd09e to your computer and use it in GitHub Desktop.
Save technolize/39735e5c89e2ad8bd09e to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $# -ne 2 ]; then
echo "usage: git diff-archive <name> <revision>"
exit 1
fi
git archive --format=zip --prefix=$1/ HEAD $(git diff --name-only HEAD $2) -o $1.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment