Skip to content

Instantly share code, notes, and snippets.

@ryonakae
Last active August 29, 2015 14:06
Show Gist options
  • Save ryonakae/87522256887c121d9b7b to your computer and use it in GitHub Desktop.
Save ryonakae/87522256887c121d9b7b to your computer and use it in GitHub Desktop.
gitで差分ファイルを抽出してzipにまとめる
# 直前のコミットとの差分
git archive --format=zip --prefix=archive/ HEAD `git diff --name-only HEAD HEAD~1` -o archive.zip
# 特定のコミットとの差分
git archive --format=zip --prefix=archive/ HEAD `git diff --name-only HEAD コミットのハッシュ値` -o archive.zip
# http://h2ham.net/git-diff-file-zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment