Skip to content

Instantly share code, notes, and snippets.

@mioyasuaki
Forked from func09/git-diff-zip.sh
Last active December 17, 2015 05:09
Show Gist options
  • Save mioyasuaki/5555807 to your computer and use it in GitHub Desktop.
Save mioyasuaki/5555807 to your computer and use it in GitHub Desktop.
指定した2つのコミットの差分ファイルを抽出して、zipファイルにする。
git archive --format=zip --prefix=<projectname>/ HEAD `git diff --name-only <oldcommit> <newcommit>` -o archive.zip
#
# <projectname> = 解凍したときにルートになるフォルダの名称を入力(名前は何でもOK)
#
# <oldcommit>, <newcommit> = コミット名(Towerの場合、Hash或いは、SHAと書かれたところに書かれている)
# ex. adf6ga242935e5c2df4b9401e1dfa2fd110ef0 みたいなやつ
#
# archive.zip の部分はファイル名(名前は何でもOK)
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment