Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 548
claf Avatar asked Mar 05 '09 17:03

claf


People also ask

What is a git snapshot?

A snapshot is a representation of the current state of your tracked files in the form of a manifest, which can be compared with other manifests to see where the differences are. Git only tracks the differences between manifests from the first moment it was tracked.

Where are git snapshots stored?

Git doesn't think of or store its data this way. Instead, Git thinks of its data more like a set of snapshots of a mini filesystem. Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.

What is the full command to take a snapshot of the current state of your project in git?

The git commit command takes all the file contents that have been staged with git add and records a new permanent snapshot in the database and then moves the branch pointer on the current branch up to it.


1 Answers

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

like image 182
jonnii Avatar answered Oct 09 '22 02:10

jonnii