-
-
Save partynight12th/3929893 to your computer and use it in GitHub Desktop.
Gitで特定のコミットからの差分ファイルだけ抜き出してZipにする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
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
Install to /usr/local/Cellar/git/2.1.1/libexec/git-core/