-
-
Save hanicker/2eb9c9466bfb372cc95ee2cb54ba253b to your computer and use it in GitHub Desktop.
Create a zip archive of a specific commit. The archive will be named deploy/deploy-COMMITID.zip.
This file contains hidden or 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
| setlocal enabledelayedexpansion | |
| set var=%1 | |
| set output= | |
| for /f "delims=" %%a in ('git diff-tree --no-commit-id --name-only -r %1^^') do ( set output=!output! "%%a" ) | |
| git archive -o update-%var:~0,7%.zip HEAD %output% | |
| endlocal |
This file contains hidden or 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
| #!/bin/sh | |
| args=("$@") | |
| git archive -o deploy/deploy-${args[1]:0:7}.zip HEAD $(git diff-tree --no-commit-id --name-only -r ${args[1]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment