Skip to content

Instantly share code, notes, and snippets.

@DDiimmkkaass
Last active September 11, 2019 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DDiimmkkaass/65954afc9259222b0e6ae28ea2333b0a to your computer and use it in GitHub Desktop.
Save DDiimmkkaass/65954afc9259222b0e6ae28ea2333b0a to your computer and use it in GitHub Desktop.
Git archive one latest commit
one commit - zip archive.zip $(git diff-tree --no-commit-id --name-only -r commit-id)
diff between commits - git diff old-commit-id new-commit-id --name-only | xargs tar -zcvf update.tar.gz
diff between commits - zip archive.zip $(git diff old-commit-id new-commit-id --name-only)
diff between commits (windows/unix) - git archive --format=zip --output=files.zip HEAD $(git diff old-commit-id new-commit-id --name-only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment