claf
claf

Reputation: 9263

Git : How to get a snapshot of a git repository

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.

Upvotes: 38

Views: 25978

Answers (2)

blueyed
blueyed

Reputation: 27878

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

Upvotes: 14

jonnii
jonnii

Reputation: 28332

git archive HEAD --format=zip > archive.zip

This does what it says on the tin.

More info here: http://gitready.com/intermediate/2009/01/29/exporting-your-repository.html

Upvotes: 56

Related Questions