gitgit-archive

Restoring a Git archive


I've followed the guides and managed to create a zip archive of my git repository, by doing this:

git archive HEAD --format=zip > c:\myarchive.zip

The reason I want to do this is that I'm done with the project, so I'm going to delete the VM I've been doing development on, but I want a backup of the work I've done so that I can refer to it later if I need to. However, I can't figure out how to open the zip file that is created.

Normally, I would double-click on a zip file to open it, but when I do, I see this error:

Windows cannot open the folder.
The Compressed (zipped) Folder 'C:\myarchive.zip' is invalid.'

I've tried recreating the zip file a couple of times, but it didn't change anything. Any thoughts?


Solution

  • unzip to a directory.

    The git archive command seems to be one way and help you create a zip archive, but assumes use of a zip tool to unzip.