Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/git-archive.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / git-archive.adoc` 248 lines ยท 8707 bytes Raw Blame History 1 git-archive(1) 2 ============== 3 4 NAME 5 ---- 6 git-archive - Create an archive of files from a named tree 7 8 9 SYNOPSIS 10 -------- 11 [verse] 12 'git archive' [--format=] [--list] [--prefix=/] [] 13 [-o | --output=] [--worktree-attributes] 14 [--remote= [--exec=]] 15 [...] 16 17 DESCRIPTION 18 ----------- 19 Creates an archive of the specified format containing the tree 20 structure for the named tree, and writes it out to the standard 21 output. If is specified it is 22 prepended to the filenames in the archive. 23 24 'git archive' behaves differently when given a tree ID as opposed to a 25 commit ID or tag ID. When a tree ID is provided, the current time is 26 used as the modification time of each file in the archive. On the 27 other hand, when a commit ID or tag ID is provided, the commit time as 28 recorded in the referenced commit object is used instead. 29 Additionally the commit ID is stored in a global extended pax header 30 if the tar format is used; it can be extracted using 'git 31 get-tar-commit-id'. In ZIP files it is stored as a file comment. 32 33 OPTIONS 34 ------- 35 36 --format=:: 37 Format of the resulting archive. Possible values are `tar`, 38 `zip`, `tar.gz`, `tgz`, and any format defined using the 39 configuration option `tar..command`. If `--format` 40 is not given, and the output file is specified, the format is 41 inferred from the filename if possible (e.g. writing to `foo.zip` 42 makes the output to be in the `zip` format). Otherwise the output 43 format is `tar`. 44 45 -l:: 46 --list:: 47 Show all available formats. 48 49 -v:: 50 --verbose:: 51 Report progress to stderr. 52 53 --prefix=/:: 54 Prepend / to paths in the archive. Can be repeated; its 55 rightmost value is used for all tracked files. See below which 56 value gets used by `--add-file`. 57 + 58 The is used as given and is not normalized. It may 59 include leading slashes or parent directory components (e.g., 60 `../`). Some archive consumers may treat such paths as 61 potentially unsafe and adjust or warn during extraction. 62 63 -o :: 64 --output=:: 65 Write the archive to instead of stdout. 66 67 --add-file=:: 68 Add a non-tracked file to the archive. Can be repeated to add 69 multiple files. The path of the file in the archive is built by 70 concatenating the value of the last `--prefix` option (if any) 71 before this `--add-file` and the basename of . 72 73 --add-virtual-file=::: 74 Add the specified contents to the archive. Can be repeated to add 75 multiple files. 76 + 77 The `` argument can start and end with a literal double-quote 78 character; the contained file name is interpreted as a C-style string, 79 i.e. the backslash is interpreted as escape character. The path must 80 be quoted if it contains a colon, to avoid the colon from being 81 misinterpreted as the separator between the path and the contents, or 82 if the path begins or ends with a double-quote character. 83 + 84 The file mode is limited to a regular file, and the option may be 85 subject to platform-dependent command-line limits. For non-trivial 86 cases, write an untracked file and use `--add-file` instead. 87 + 88 Note that unlike `--add-file` the path created in the archive is not 89 affected by the `--prefix` option, as a full `` can be given as 90 the value of the option. 91 92 --worktree-attributes:: 93 Look for attributes in .gitattributes files in the working tree 94 as well (see <>). 95 96 --mtime=