VPS business hosting starting at $29.95/24/7 premium technical support

How to generate a patch with edited files? How to zip latest committed changes only

zip archive.zip $(git diff-tree --no-commit-id --name-only -r latest-commit-id)

Reference: https://stackoverflow.com/a/42971972/2229148

sometimes you need all the files that were updated so you can patch an external app which doesnt uses same git project or many other scenarios in which we need a zip or tar of those files. Use the above command to do so

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

Leave a Reply

Your email address will not be published. Required fields are marked *