In Git Bash I've tried to use this command:
$ git archive -o test.tar.gz master
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h
The file test.tar.gz
is empty, but my repository is not empty and creating a zip file works fine (contains all my source files)! Why does the tarball format fail to produce an archive?
This appears to be a compatibility problem between the way git archive
wants to pipe content from tar
to gzip
and the way Windows handles pipes. You can generate the same error message by piping tar
into gzip
manually:
$ tar -c file.txt | gzip
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h
These two commands work for me on Windows 7, and should be functionally identical to the one you're trying:
$ git archive -o test.tar master
$ gzip test.tar
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