SARATH (@sarat) Essays and writings

How To Export Your Git Repo

I am a bit wary when it comes to exporting the archive. I am pretty happy about Downloading the zip archive from GitHub but how do I do this with a local repository? The default archive utility is so plain but I like it. But what if I don't want to share my .git repo the temporary output files?

There's a handy utility comes with git which helps you to archive/export your repository just like you download from GitHub. You can use tar or zip format as output.

Here's an example

git archive --format=zip -9 HEAD -o <file-name>

This will compress your current branch in Zip format with highest level of compression (-9) to the output <file-name> specified.

For more information have a look at the git-archive man page.