Last Updated: February 25, 2016
·
22.05K
· wuotr

Export a Git branch (to ZIP)

The beloved command:
git archive --format zip --output /full/path/to/zipfile.zip master

And if you'd like to define a specific top level directory (name) to be extracted... you can use this command:
git archive --format zip --output /path/to/file.zip --prefix=newdir/ master

(The output will be called 'file.zip' but when you unpack it, the top level directory will be 'newdir'.)