Created
May 30, 2018 13:00
-
-
Save jirolabo/b311788be981ab7d412711c15837b858 to your computer and use it in GitHub Desktop.
SourceTree(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
if "%2" EQU "" ( | |
set PARAM1=HEAD | |
set PARAM2=%1 | |
) else ( | |
set PARAM1=%1 | |
set PARAM2=%2 | |
) | |
chcp 65001 | |
setlocal enabledelayedexpansion | |
set RET_DIR= | |
for /F "usebackq" %%i in (`"C:\Program Files\Git\bin\git" diff --name-only %PARAM1% %PARAM2%`) do ( | |
set RET_DIR=!RET_DIR! "%%i" | |
) | |
"C:\Program Files\Git\bin\git" archive --format=zip --prefix=archive/ %PARAM1% %RET_DIR% -o archive.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment