1

I use Bitbucket and I am looking to create a zip file between commits so that I can supply only the changed files to a client. I currently use:

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2)

Which works absolutely fine if all the files are there. However if there is a file that has been deleted between commits I get the error:

fatal: pathspec 'FILENAME' did not match any files

What is the best way of doing this, can you do it in Bitbucket, Git Gui or Git Bash?

generalcb
  • 143
  • 2
  • 13

1 Answers1

1

Looks like the option diff-filter with lowercase d excludes deleted files:

git archive --output=changes.zip HEAD $(git diff --name-only --diff-filter=d SHA1 SHA2)
generalcb
  • 143
  • 2
  • 13