Skip to content

Instantly share code, notes, and snippets.

@partynight12th
Forked from func09/git-diff-zip.sh
Created October 22, 2012 05:44
Show Gist options
  • Save partynight12th/3929893 to your computer and use it in GitHub Desktop.
Save partynight12th/3929893 to your computer and use it in GitHub Desktop.
Gitで特定のコミットからの差分ファイルだけ抜き出してZipにする
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: git diff-zip <archive_name> <oldCommit> <newCommit>"
exit 1
fi
git archive --format=zip --prefix=$1/ $3 `git diff --name-only $2 $3` -o ../$1.zip
@kkotaro0111
Copy link

git archive --format=zip --prefix=$1/ $3 `git diff --diff-filter=ARM --name-only $2 $3` -o ../$1.zip

削除ファイルも表示されてしまい、エラーが起きるので、上記に変更

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment