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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With