Git Tip: Creating Zip Of Changed Files

Written by Ashley Broadley on Friday, 30th September 2011 at 13:10

A lot of my current projects in my new job require making changes to files where the main application isn't cloned from a repository. To combat the problem of having to upload each file that's changed between release tags, I used the following to create a zip file of all the changed files:

git archive --format zip -o changed.zip HEAD `git diff --name-only HASH`

Replace HASH with the version you last used to update your live application and the end result will be a zip file called 'changed.zip' which contains all of the files that have changed since the changeset you specified in HASH.

All done. Simples!

Tags: #git, #protip, Comments: Be the first!


Comments closed

Comments:

No Comments Yet!