Git pathspec error when using git archive
I have two branches Master
and Newsletterdesign
, and I need the differences from Newsletterdesign
, but I have a problem with a git archive:
$ git archive -o Name.zip 5a5e099 $(git diff --name-only 5a5e099^..5a5e099)
Error: fatal: pathspec '-' did not match any files
Any idea? Thank.
source to share
The command you tried should work. It is right. And the reason for the error you are getting lies in some additional files that are not added to git. Please check Untracked files
with git status
. If you have any untracked files you can add them to git or delete them, or else you can hide them ( git stash
)
I tried your command, it works great. git archive -o update.zip HEAD $(git diff --name-only 70a1ab8^..f62c8eb)
source to share