Created
April 2, 2012 14:56
-
-
Save betweenbrain/2284129 to your computer and use it in GitHub Desktop.
Git command to export only changed files between two commits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2) |
@Mart-Bogdan, try this:
git diff --name-only -z --diff-filter=ACMRT release..HEAD | xargs -0 git archive -o update.tar.gz HEAD --
archives changes between commit tagged release and HEAD. Works with files containing spaces.
git diff --name-only SHA1..SHA2 | xargs tar -zcf update.tar.gz
or
tar -zcf update.tar.gz
git diff --name-only SHA1..SHA2
For some weird reason, when I try tar -zcf
(attempting to generate a gzipped version) it just doesn't save all the affected files. However, if I use tar -rf
it does work as intended.
Any idea why that is ocurring?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's failing if any file contain spaces in it's name.
Do you have any ideas how to fix this?