Git Archive

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


  • git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o <file> | --output=<file>] [--worktree-attributes] [--remote=<repo> [ --exec=<git-upload-archive>]] <tree-ish> [<path>...]


--format=<fmt>Format of the resulting archive: tar or zip. If this options is not given and the output file is specified, the format is inferred from the filename if possible. Otherwise, defaults to tar.
-l, --listShow all available formats.
-v, --verboseReport progress to stderr.
--prefix=<prefix>/Prepend <prefix>/ to each filename in the archive.
-o <file>, --output=<file>Write the archive to <file> instead of stdout.
--worktree-attributesLook for attributes in .gitattributes files in the working tree.
<extra>This can be any options that the archiver backend understands. For zip backend, using -0 will store the files without deflating them, while -1 through -9 can be used to adjust compression speed and ratio.
--remote=<repo>Retrieve a tar archive from a remote repository <repo> rather than the local repository.
--exec=<git-upload-archive>Used with --remote to specify the path to the <git-upload-archive on the remote.
<tree-ish>The tree or commit to produce an archive for.
<path>Without an optional parameter, all files and directories in the current working directory are included in the archive. If one or more paths are specified, only these are included.

Got any Git Question?