Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

archive

Synopsis

git archive [--remote=repository-path] [--format=zip] revision -- [path ...] >outputfile

Create a tar or zip format archive from the current repository or from the repository at repository-path if --remote is specified. The default output file format is (uncompressed) tar, but git archive can also produce a zip file instead if you specify --format=zip.

git archive always writes the new archive to standard output, so you should redirect or pipe its output somewhere.

You must specify the revision from which to take the files. If you want to use the current revision, use HEAD.

If you specify one or more paths, only those paths are included in the produced archive.

Options

--list
--remote
--format=tar|zip

Examples

To list the available options for --format:

$ git archive --list
tar
zip

To create a tar.gz file of the currently checked-out revision:

$ git archive HEAD | gzip >my-release.tar.gz

To create a zip file of tag v1.2 in a repository from another computer named myserver (where you have Unix shell access via ssh):

$ git archive --format=zip --remote=myserver:src/myapp.git
v1.2 >myapp-1.2.zip
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page