I am looking for a simple solution to make a archive of recent changed file.
I get this simple command from google
git archive -o update.zip HEAD $(git diff --name-only HEAD^)
When I run it in GIT BUSH, it keeps saying saying fatal: Not a valid object name
I'm using this answer in that case that tells me to
tar czf changed-files.tar.gz `git diff --name-only [diff options]`
For example, to create an archive containing the files changed in the last four revisions, I'd do
tar czf changed-files.tar.gz `git diff --name-only HEAD~4..`
This assumes – of course – that HEAD~4
does actually exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With