7zip ist nicht kompatibel mit dem vom Git-Archiv erstellten Tar-Format

7zip ist nicht kompatibel mit dem vom Git-Archiv erstellten Tar-Format
% git archive --format tar master > archive.tar
% file archive.tar
archive.tar: POSIX tar archive

% tar cf a.tar archive.tar
% file a.tar
a.tar: POSIX tar archive (GNU)

7zip cannot unpack tar archive created by "git archive". Apparently there are some differences.

The reason I'm asking is that I would like to be able to unpack tar archive from git on Windows and 7zip is great utility. Is there some flag/workaround (short of unpacking tar archive created by git and packing it with GNU tar).

Antwort1

git-archive only creates PAX tar archives, and 7-Zip is incapable of reading PAX tar archives. Either use a different format with git-archive, post-process the archives created to recompress using tar, or use a different tool under Windows.

Antwort2

$: git archive --list
tar
tgz
tar.gz
zip

Wird Zip in der Liste der verfügbaren Archive aufgeführt? Könnten Sie zum Erstellen nicht einfach Zip statt Tar verwenden?

Wenn Sie zum Archivieren Git verwenden, wundern Sie sich vielleicht, dass es keine Möglichkeit gibt, das Archiv mit demselben Tool zu extrahieren. Wir haben Glück, denn dies ist auf den Manpages zu finden:

git-get-tar-commit-id(1)
       Extract commit ID from an archive created using git-archive.

verwandte Informationen