git archive
2022-09-02
To extract the current directory into a tar with a prefix:
git archive $tag –prefix $prefix/ . | gzip > $packagename.tar.gz
I think $prefix
and $packagename
will often be identical. $prefix
will often include at leart part of $tag
.
Examples:
git archive agestat-2022.09.02 --prefix agestat-2022.09.02/ . | gzip > agestat-2022.09.02.tar.gz
git archive release-2.9 --prefix theprogram-2.9/ . | gzip > theprogram-2.9.tar.gz