I have a PHP project (an wordpress plugin). When i need to publish this project to a remote test or production server, I have to send files through common FTP. In order not to upload all files, I'd like to obtain only modified files from the last build.
Is there an way to use GIT to, given two different branches or commits, create a folder with files changed or added between this two branches/commit. This would give me all files I have to upload.
I've tried using git diff branch1..branch2 > result.diff
, but that would give me a single text file with all changes, and that wont't help with the FTP upload process, I'd like to copy all changed/added files to a folder, following the same folder structure, so i could just upload this folder.
Edit:
Based on @LeGEC answer, I wrote a little command line utility that read the results of gitDiff and generate a folder with the files. If someone is interested, its on GitHub: