Git : How to get a snapshot of a git repository

前端 未结 2 1227
死守一世寂寞
死守一世寂寞 2020-12-24 05:52

I\'m looking for the right way to get an archive of a git repository without the .git/ directory in order to send a daily snapshot to testers.

2条回答
  •  死守一世寂寞
    2020-12-24 06:41

    This will result in archive.tar.gz and add a prefix dir named "prefix-dir":

    git archive --prefix=prefix-dir/ -o archive.tar HEAD
    gzip archive.tar
    

提交回复
热议问题