I use this command to export all files in specify commit(s)
git archive --output=export.zip --format=zip HEAD $(git diff --name-only COMMIT1 COMMIT2)
I want to make an alias so I dont need type this long command everytime.
I tried:
git config --global alias.he "archive --output=\"$1\" --format=zip HEAD \$(git diff --name-only \"$2\" \"$3\")
However, when I run git he 1.zip COMMIT1 COMMIT2
, it prompts
error: unknown option `name-only'
Could anyone help me for this?
Thanks