Skip to content

Instantly share code, notes, and snippets.

@girvydas
Last active January 3, 2016 06:09
Show Gist options
  • Save girvydas/453a361b8828d6cbcbd6 to your computer and use it in GitHub Desktop.
Save girvydas/453a361b8828d6cbcbd6 to your computer and use it in GitHub Desktop.
Create ZIP from commits changes
git archive -o update.zip HEAD $(git diff --name-only NUO-KURIO-COMMIT)
---------
git archive -o update.zip HEAD $(git diff --diff-filter=AM --name-only NUO-KURIO-COMMIT HEAD)
---------
git archive -o ../latest.zip some-commit $(git diff --name-only earlier-commit some-commit)
---------
git diff --name-only earlier-commit some-commit | xargs -d'\n' git archive -o ../latest.zip some-commit
----------
#!/bin/bash
IFS=$'\n'
files=($(git diff --name-only earlier-commit some-commit))
git archive -o ../latest.zip some-commit "${files[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment