How to transfer file list to linux zip command

I use Git for version control and, unlike SVN, I have not encountered the inherent means of exporting modified files between two revisions, branches, or tags.

Alternatively, I want to use the linux zip command and pass it a set of file names, however the file names are the result of another Git diff command. The following is an example of what I'm trying to achieve:

zip /home/myhome/releases/files.zip git diff --name-only -a 01-tag 00-tag

However, the above does not work, since I think the zip command sees the Git operation as part of its command parameters.

Does anyone know how I can do something like the above work?

thank

+5
source share
2

git -:

zip /home/myhome/releases/files.zip `git diff --name-only -a 01-tag 00-tag`
# another syntax (assuming bash):
zip /home/myhome/releases/files.zip $(git diff --name-only -a 01-tag 00-tag)

xargs:

git diff --name-only -a 01-tag 00-tag | xargs zip /home/myhome/releases/files.zip
+6

git (bash), :

git diff -–name-only commit1 commit2 | zip ../Changes.zip –@

Windows Unix.

+3

All Articles