/usr/share/doc/git
git-archive(1) ============== NAME ---- git-archive - Create an archive of files from a named tree SYNOPSIS -------- [verse] 'git archive' [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o <file> | --output=<file>] [--worktree-attributes] [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish> [<path>...] DESCRIPTION ----------- Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output. If <prefix> is specified it is prepended to the filenames in the archive. 'git archive' behaves differently when given a tree ID as opposed to a commit ID or tag ID. When a tree ID is provided, the current time is used as the modification time of each file in the archive. On the other hand, when a commit ID or tag ID is provided, the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header if the tar format is used; it can be extracted using 'git get-tar-commit-id'. In ZIP files it is stored as a file comment. OPTIONS ------- --format=<fmt>:: Format of the resulting archive. Possible values are `tar`, `zip`, `tar.gz`, `tgz`, and any format defined using the configuration option `tar.<format>.command`. If `--format` is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to `foo.zip` makes the output to be in the `zip` format). Otherwise the output format is `tar`. -l:: --list:: Show all available formats. -v:: --verbose:: Report progress to stderr. --prefix=<prefix>/:: Prepend <prefix>/ to paths in the archive. Can be repeated; its rightmost value is used for all tracked files. See below which value gets used by `--add-file`. -o <file>:: --output=<file>:: Write the archive to <file> instead of stdout. --add-file=<file>:: Add a non-tracked file to the archive. Can be repeated to add multiple files. The path of the file in the archive is built by concatenating the value of the last `--prefix` option (if any) before this `--add-file` and the basename of <file>. --add-virtual-file=<path>:<content>:: Add the specified contents to the archive. Can be repeated to add multiple files. + The `<path>` argument can start and end with a literal double-quote character; the contained file name is interpreted as a C-style string, i.e. the backslash is interpreted as escape character. The path must be quoted if it contains a colon, to avoid the colon from being misinterpreted as the separator between the path and the contents, or if the path begins or ends with a double-quote character. + The file mode is limited to a regular file, and the option may be subject to platform-dependent command-line limits. For non-trivial cases, write an untracked file and use `--add-file` instead. + Note that unlike `--add-file` the path created in the archive is not affected by the `--prefix` option, as a full `<path>` can be given as the value of the option. --worktree-attributes:: Look for attributes in .gitattributes files in the working tree as well (see <<ATTRIBUTES>>). --mtime=<time>:: Set modification time of archive entries. Without this option the committer time is used if `<tree-ish>` is a commit or tag, and the current time if it is a tree. <extra>:: This can be any options that the archiver backend understands. See next section. --remote=<repo>:: Instead of making a tar archive from the local repository, retrieve a tar archive from a remote repository. Note that the remote repository may place restrictions on which sha1 expressions may be allowed in `<tree-ish>`. See linkgit:git-upload-archive[1] for details. --exec=<git-upload-archive>:: Used with --remote to specify the path to the 'git-upload-archive' on the remote side. <tree-ish>:: The tree or commit to produce an archive for. <path>:: Without an optional path parameter, all files and subdirectories of the current working directory are included in the archive. If one or more paths are specified, only these are included. BACKEND EXTRA OPTIONS --------------------- zip ~~~ -<digit>:: Specify compression level. Larger values allow the command to spend more time to compress to smaller size. Supported values are from `-0` (store-only) to `-9` (best ratio). Default is `-6` if not given. tar ~~~ -<number>:: Specify compression level. The value will be passed to the compression command configured in `tar.<format>.command`. See manual page of the configured command for the list of supported levels and the default level if this option isn't specified. CONFIGURATION ------------- tar.umask:: This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. If `--remote` is used then only the configuration of the remote repository takes effect. tar.<format>.command:: This variable specifies a shell command through which the tar output generated by `git archive` should be piped. The command is executed using the shell with the generated tar file on its standard input, and should produce the final output on its standard output. Any compression-level options will be passed to the command (e.g., `-9`). + The `tar.gz` and `tgz` formats are defined automatically and use the magic command `git archive gzip` by default, which invokes an internal implementation of gzip. tar.<format>.remote:: If true, enable the format for use by remote clients via linkgit:git-upload-archive[1]. Defaults to false for user-defined formats, but true for the `tar.gz` and `tgz` formats. [[ATTRIBUTES]] ATTRIBUTES ---------- export-ignore:: Files and directories with the attribute export-ignore won't be added to archive files. See linkgit:gitattributes[5] for details. export-subst:: If the attribute export-subst is set for a file then Git will expand several placeholders when adding this file to an archive. See linkgit:gitattributes[5] for details. Note that attributes are by default taken from the `.gitattributes` files in the tree that is being archived. If you want to tweak the way the output is generated after the fact (e.g. you committed without adding an appropriate export-ignore in its `.gitattributes`), adjust the checked out `.gitattributes` file as necessary and use `--worktree-attributes` option. Alternatively you can keep necessary attributes that should apply while archiving any tree in your `$GIT_DIR/info/attributes` file. EXAMPLES -------- `git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)`:: Create a tar archive that contains the contents of the latest commit on the current branch, and extract it in the `/var/tmp/junk` directory. `git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz`:: Create a compressed tarball for v1.4.0 release. `git archive --format=tar.gz --prefix=git-1.4.0/ v1.4.0 >git-1.4.0.tar.gz`:: Same as above, but using the builtin tar.gz handling. `git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0`:: Same as above, but the format is inferred from the output file. `git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip >git-1.4.0.tar.gz`:: Create a compressed tarball for v1.4.0 release, but without a global extended pax header. `git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > git-1.4.0-docs.zip`:: Put everything in the current head's Documentation/ directory into 'git-1.4.0-docs.zip', with the prefix 'git-docs/'. `git archive -o latest.zip HEAD`:: Create a Zip archive that contains the contents of the latest commit on the current branch. Note that the output format is inferred by the extension of the output file. `git archive -o latest.tar --prefix=build/ --add-file=configure --prefix= HEAD`:: Creates a tar archive that contains the contents of the latest commit on the current branch with no prefix and the untracked file 'configure' with the prefix 'build/'. `git config tar.tar.xz.command "xz -c"`:: Configure a "tar.xz" format for making LZMA-compressed tarfiles. You can use it specifying `--format=tar.xz`, or by creating an output file like `-o foo.tar.xz`. SEE ALSO -------- linkgit:gitattributes[5] GIT --- Part of the linkgit:git[1] suite
.
Edit
..
Edit
BreakingChanges.txt
Edit
CODE_OF_CONDUCT.md
Edit
DecisionMaking.html
Edit
DecisionMaking.txt
Edit
MyFirstContribution.html
Edit
MyFirstContribution.txt
Edit
MyFirstObjectWalk.html
Edit
MyFirstObjectWalk.txt
Edit
README.md
Edit
RelNotes
Edit
ReviewingGuidelines.html
Edit
ReviewingGuidelines.txt
Edit
SubmittingPatches.html
Edit
SubmittingPatches.txt
Edit
ToolsForGit.html
Edit
ToolsForGit.txt
Edit
blame-options.txt
Edit
cmds-ancillaryinterrogators.txt
Edit
cmds-ancillarymanipulators.txt
Edit
cmds-developerinterfaces.txt
Edit
cmds-foreignscminterface.txt
Edit
cmds-guide.txt
Edit
cmds-mainporcelain.txt
Edit
cmds-plumbinginterrogators.txt
Edit
cmds-plumbingmanipulators.txt
Edit
cmds-purehelpers.txt
Edit
cmds-synchelpers.txt
Edit
cmds-synchingrepositories.txt
Edit
cmds-userinterfaces.txt
Edit
config.txt
Edit
contrib
Edit
date-formats.txt
Edit
diff-format.txt
Edit
diff-generate-patch.txt
Edit
diff-options.txt
Edit
docbook-xsl.css
Edit
docinfo.html
Edit
everyday.html
Edit
fetch-options.txt
Edit
fsck-msgids.txt
Edit
git-add.html
Edit
git-add.txt
Edit
git-am.html
Edit
git-am.txt
Edit
git-annotate.html
Edit
git-annotate.txt
Edit
git-apply.html
Edit
git-apply.txt
Edit
git-archive.html
Edit
git-archive.txt
Edit
git-bisect-lk2009.html
Edit
git-bisect-lk2009.txt
Edit
git-bisect.html
Edit
git-bisect.txt
Edit
git-blame.html
Edit
git-blame.txt
Edit
git-branch.html
Edit
git-branch.txt
Edit
git-bugreport.html
Edit
git-bugreport.txt
Edit
git-bundle.html
Edit
git-bundle.txt
Edit
git-cat-file.html
Edit
git-cat-file.txt
Edit
git-check-attr.html
Edit
git-check-attr.txt
Edit
git-check-ignore.html
Edit
git-check-ignore.txt
Edit
git-check-mailmap.html
Edit
git-check-mailmap.txt
Edit
git-check-ref-format.html
Edit
git-check-ref-format.txt
Edit
git-checkout-index.html
Edit
git-checkout-index.txt
Edit
git-checkout.html
Edit
git-checkout.txt
Edit
git-cherry-pick.html
Edit
git-cherry-pick.txt
Edit
git-cherry.html
Edit
git-cherry.txt
Edit
git-clean.html
Edit
git-clean.txt
Edit
git-clone.html
Edit
git-clone.txt
Edit
git-column.html
Edit
git-column.txt
Edit
git-commit-graph.html
Edit
git-commit-graph.txt
Edit
git-commit-tree.html
Edit
git-commit-tree.txt
Edit
git-commit.html
Edit
git-commit.txt
Edit
git-config.html
Edit
git-config.txt
Edit
git-contacts.html
Edit
git-contacts.txt
Edit
git-count-objects.html
Edit
git-count-objects.txt
Edit
git-credential-cache--daemon.html
Edit
git-credential-cache--daemon.txt
Edit
git-credential-cache.html
Edit
git-credential-cache.txt
Edit
git-credential-store.html
Edit
git-credential-store.txt
Edit
git-credential.html
Edit
git-credential.txt
Edit
git-describe.html
Edit
git-describe.txt
Edit
git-diagnose.html
Edit
git-diagnose.txt
Edit
git-diff-files.html
Edit
git-diff-files.txt
Edit
git-diff-index.html
Edit
git-diff-index.txt
Edit
git-diff-tree.html
Edit
git-diff-tree.txt
Edit
git-diff.html
Edit
git-diff.txt
Edit
git-difftool.html
Edit
git-difftool.txt
Edit
git-fast-export.html
Edit
git-fast-export.txt
Edit
git-fast-import.html
Edit
git-fast-import.txt
Edit
git-fetch-pack.html
Edit
git-fetch-pack.txt
Edit
git-fetch.html
Edit
git-fetch.txt
Edit
git-filter-branch.html
Edit
git-filter-branch.txt
Edit
git-fmt-merge-msg.html
Edit
git-fmt-merge-msg.txt
Edit
git-for-each-ref.html
Edit
git-for-each-ref.txt
Edit
git-for-each-repo.html
Edit
git-for-each-repo.txt
Edit
git-format-patch.html
Edit
git-format-patch.txt
Edit
git-fsck-objects.html
Edit
git-fsck-objects.txt
Edit
git-fsck.html
Edit
git-fsck.txt
Edit
git-fsmonitor--daemon.html
Edit
git-fsmonitor--daemon.txt
Edit
git-gc.html
Edit
git-gc.txt
Edit
git-get-tar-commit-id.html
Edit
git-get-tar-commit-id.txt
Edit
git-grep.html
Edit
git-grep.txt
Edit
git-hash-object.html
Edit
git-hash-object.txt
Edit
git-help.html
Edit
git-help.txt
Edit
git-hook.html
Edit
git-hook.txt
Edit
git-http-backend.html
Edit
git-http-backend.txt
Edit
git-http-fetch.html
Edit
git-http-fetch.txt
Edit
git-http-push.html
Edit
git-http-push.txt
Edit
git-imap-send.html
Edit
git-imap-send.txt
Edit
git-index-pack.html
Edit
git-index-pack.txt
Edit
git-init-db.html
Edit
git-init-db.txt
Edit
git-init.html
Edit
git-init.txt
Edit
git-interpret-trailers.html
Edit
git-interpret-trailers.txt
Edit
git-log.html
Edit
git-log.txt
Edit
git-ls-files.html
Edit
git-ls-files.txt
Edit
git-ls-remote.html
Edit
git-ls-remote.txt
Edit
git-ls-tree.html
Edit
git-ls-tree.txt
Edit
git-mailinfo.html
Edit
git-mailinfo.txt
Edit
git-mailsplit.html
Edit
git-mailsplit.txt
Edit
git-maintenance.html
Edit
git-maintenance.txt
Edit
git-merge-base.html
Edit
git-merge-base.txt
Edit
git-merge-file.html
Edit
git-merge-file.txt
Edit
git-merge-index.html
Edit
git-merge-index.txt
Edit
git-merge-one-file.html
Edit
git-merge-one-file.txt
Edit
git-merge-tree.html
Edit
git-merge-tree.txt
Edit
git-merge.html
Edit
git-merge.txt
Edit
git-mergetool--lib.html
Edit
git-mergetool--lib.txt
Edit
git-mergetool.html
Edit
git-mergetool.txt
Edit
git-mktag.html
Edit
git-mktag.txt
Edit
git-mktree.html
Edit
git-mktree.txt
Edit
git-multi-pack-index.html
Edit
git-multi-pack-index.txt
Edit
git-mv.html
Edit
git-mv.txt
Edit
git-name-rev.html
Edit
git-name-rev.txt
Edit
git-notes.html
Edit
git-notes.txt
Edit
git-pack-objects.html
Edit
git-pack-objects.txt
Edit
git-pack-redundant.html
Edit
git-pack-redundant.txt
Edit
git-pack-refs.html
Edit
git-pack-refs.txt
Edit
git-patch-id.html
Edit
git-patch-id.txt
Edit
git-prune-packed.html
Edit
git-prune-packed.txt
Edit
git-prune.html
Edit
git-prune.txt
Edit
git-pull.html
Edit
git-pull.txt
Edit
git-push.html
Edit
git-push.txt
Edit
git-quiltimport.html
Edit
git-quiltimport.txt
Edit
git-range-diff.html
Edit
git-range-diff.txt
Edit
git-read-tree.html
Edit
git-read-tree.txt
Edit
git-rebase.html
Edit
git-rebase.txt
Edit
git-receive-pack.html
Edit
git-receive-pack.txt
Edit
git-reflog.html
Edit
git-reflog.txt
Edit
git-refs.html
Edit
git-refs.txt
Edit
git-remote-ext.html
Edit
git-remote-ext.txt
Edit
git-remote-fd.html
Edit
git-remote-fd.txt
Edit
git-remote-helpers.html
Edit
git-remote.html
Edit
git-remote.txt
Edit
git-repack.html
Edit
git-repack.txt
Edit
git-replace.html
Edit
git-replace.txt
Edit
git-replay.html
Edit
git-replay.txt
Edit
git-request-pull.html
Edit
git-request-pull.txt
Edit
git-rerere.html
Edit
git-rerere.txt
Edit
git-reset.html
Edit
git-reset.txt
Edit
git-restore.html
Edit
git-restore.txt
Edit
git-rev-list.html
Edit
git-rev-list.txt
Edit
git-rev-parse.html
Edit
git-rev-parse.txt
Edit
git-revert.html
Edit
git-revert.txt
Edit
git-rm.html
Edit
git-rm.txt
Edit
git-send-pack.html
Edit
git-send-pack.txt
Edit
git-sh-i18n--envsubst.html
Edit
git-sh-i18n--envsubst.txt
Edit
git-sh-i18n.html
Edit
git-sh-i18n.txt
Edit
git-sh-setup.html
Edit
git-sh-setup.txt
Edit
git-shell.html
Edit
git-shell.txt
Edit
git-shortlog.html
Edit
git-shortlog.txt
Edit
git-show-branch.html
Edit
git-show-branch.txt
Edit
git-show-index.html
Edit
git-show-index.txt
Edit
git-show-ref.html
Edit
git-show-ref.txt
Edit
git-show.html
Edit
git-show.txt
Edit
git-sparse-checkout.html
Edit
git-sparse-checkout.txt
Edit
git-stage.html
Edit
git-stage.txt
Edit
git-stash.html
Edit
git-stash.txt
Edit
git-status.html
Edit
git-status.txt
Edit
git-stripspace.html
Edit
git-stripspace.txt
Edit
git-submodule.html
Edit
git-submodule.txt
Edit
git-switch.html
Edit
git-switch.txt
Edit
git-symbolic-ref.html
Edit
git-symbolic-ref.txt
Edit
git-tag.html
Edit
git-tag.txt
Edit
git-tools.html
Edit
git-tools.txt
Edit
git-unpack-file.html
Edit
git-unpack-file.txt
Edit
git-unpack-objects.html
Edit
git-unpack-objects.txt
Edit
git-update-index.html
Edit
git-update-index.txt
Edit
git-update-ref.html
Edit
git-update-ref.txt
Edit
git-update-server-info.html
Edit
git-update-server-info.txt
Edit
git-upload-archive.html
Edit
git-upload-archive.txt
Edit
git-upload-pack.html
Edit
git-upload-pack.txt
Edit
git-var.html
Edit
git-var.txt
Edit
git-verify-commit.html
Edit
git-verify-commit.txt
Edit
git-verify-pack.html
Edit
git-verify-pack.txt
Edit
git-verify-tag.html
Edit
git-verify-tag.txt
Edit
git-version.html
Edit
git-version.txt
Edit
git-web--browse.html
Edit
git-web--browse.txt
Edit
git-whatchanged.html
Edit
git-whatchanged.txt
Edit
git-worktree.html
Edit
git-worktree.txt
Edit
git-write-tree.html
Edit
git-write-tree.txt
Edit
git.html
Edit
git.txt
Edit
gitattributes.html
Edit
gitattributes.txt
Edit
gitcli.html
Edit
gitcli.txt
Edit
gitcore-tutorial.html
Edit
gitcore-tutorial.txt
Edit
gitcredentials.html
Edit
gitcredentials.txt
Edit
gitdiffcore.html
Edit
gitdiffcore.txt
Edit
giteveryday.html
Edit
giteveryday.txt
Edit
gitfaq.html
Edit
gitfaq.txt
Edit
gitformat-bundle.html
Edit
gitformat-bundle.txt
Edit
gitformat-chunk.html
Edit
gitformat-chunk.txt
Edit
gitformat-commit-graph.html
Edit
gitformat-commit-graph.txt
Edit
gitformat-index.html
Edit
gitformat-index.txt
Edit
gitformat-pack.html
Edit
gitformat-pack.txt
Edit
gitformat-signature.html
Edit
gitformat-signature.txt
Edit
gitglossary.html
Edit
gitglossary.txt
Edit
githooks.html
Edit
githooks.txt
Edit
gitignore.html
Edit
gitignore.txt
Edit
gitmailmap.html
Edit
gitmailmap.txt
Edit
gitmodules.html
Edit
gitmodules.txt
Edit
gitnamespaces.html
Edit
gitnamespaces.txt
Edit
gitpacking.html
Edit
gitpacking.txt
Edit
gitprotocol-capabilities.html
Edit
gitprotocol-capabilities.txt
Edit
gitprotocol-common.html
Edit
gitprotocol-common.txt
Edit
gitprotocol-http.html
Edit
gitprotocol-http.txt
Edit
gitprotocol-pack.html
Edit
gitprotocol-pack.txt
Edit
gitprotocol-v2.html
Edit
gitprotocol-v2.txt
Edit
gitremote-helpers.html
Edit
gitremote-helpers.txt
Edit
gitrepository-layout.html
Edit
gitrepository-layout.txt
Edit
gitrevisions.html
Edit
gitrevisions.txt
Edit
gitsubmodules.html
Edit
gitsubmodules.txt
Edit
gittutorial-2.html
Edit
gittutorial-2.txt
Edit
gittutorial.html
Edit
gittutorial.txt
Edit
gitworkflows.html
Edit
gitworkflows.txt
Edit
glossary-content.txt
Edit
howto
Edit
howto-index.html
Edit
howto-index.txt
Edit
i18n.txt
Edit
line-range-format.txt
Edit
line-range-options.txt
Edit
merge-options.txt
Edit
merge-strategies.txt
Edit
mergetools-diff.txt
Edit
mergetools-merge.txt
Edit
object-format-disclaimer.txt
Edit
pretty-formats.txt
Edit
pretty-options.txt
Edit
pull-fetch-param.txt
Edit
ref-reachability-filters.txt
Edit
ref-storage-format.txt
Edit
rerere-options.txt
Edit
rev-list-description.txt
Edit
rev-list-options.txt
Edit
revisions.txt
Edit
scalar.html
Edit
scalar.txt
Edit
sequencer.txt
Edit
signoff-option.txt
Edit
technical
Edit
trace2-target-values.txt
Edit
transfer-data-leaks.txt
Edit
urls-remotes.txt
Edit
urls.txt
Edit
user-manual.html
Edit
user-manual.txt
Edit