Skip to content

Instantly share code, notes, and snippets.

@emileber
Last active September 13, 2015 21:06
Show Gist options
  • Save emileber/9c5fd559e7669e32a9f9 to your computer and use it in GitHub Desktop.
Save emileber/9c5fd559e7669e32a9f9 to your computer and use it in GitHub Desktop.
Creates a zip archive named `YYY-MM-DD_update.zip` including only changed files using git from specified commit-id relative to the current directory.
@echo off
setlocal enabledelayedexpansion
git diff --name-only --relative %1^^
set SAVESTAMP=%DATE:/=-%
set output=
for /f "delims=" %%a in ('git diff --name-only --relative %1^^') do ( set output=!output! "%%a" )
git archive -o %SAVESTAMP%_update.zip HEAD %output%
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment