Skip to content

Instantly share code, notes, and snippets.

@nasitra
Last active November 20, 2015 12:54
Show Gist options
  • Save nasitra/a5288d35a32a7137a517 to your computer and use it in GitHub Desktop.
Save nasitra/a5288d35a32a7137a517 to your computer and use it in GitHub Desktop.
Make changed files between master branch and current branch
git archive --format=zip --prefix=master/ master `git diff --name-only HEAD master` -o master.zip
git archive --format=zip --prefix=current/ HEAD `git diff --name-only HEAD master` -o current.zip
set COMMAND_FILE= __command__.txt
for /f "usebackq tokens=*" %a in (`git diff --name-only HEAD master`) do set /p NOLINEBREAK=%a <NUL >> %COMMAND_FILE%
for /f "usebackq tokens=*" %a in (`type %COMMAND_FILE%`) do git archive --format=zip --prefix=master/ master %a -o master.zip
for /f "usebackq tokens=*" %a in (`type %COMMAND_FILE%`) do git archive --format=zip --prefix=current/ HEAD %a -o current.zip
del %COMMAND_FILE%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment