I\'m using this git command to create an archive of the files modified within a specific commit:
git archive -o update.zip HEAD $(git diff --name-only COMMIT
Assuming you need a windows batch file, and not a bash script, here is a minimal batch file that may do what you want:
setlocal enabledelayedexpansion
set output=
for /f "delims=" %%a in ('git diff --name-only %1^^') do ( set output=!output! "%%a" )
git archive -o update.zip HEAD %output%
endlocal
It works by collecting all lines of the output of the git diff ...
command into an environment variable, and then using this to perform the git archive ...
operation.
Documentation for the Windows for
command is here, including the /f
switch. Documentation for the setlocal
command is here.