Home Explore Blog CI



git

2nd chunk of `Documentation/git-archive.adoc`
e6ba5e60cc422960a104f57984d1480a37d1387e746e0a050000000100000abc
 `<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

Title: Git Archive Options and Configuration
Summary
The git-archive command provides various options for customizing the archive creation process, including settings for modification time, remote repositories, and compression levels, as well as configuration variables for controlling tar archive permissions, commands, and formats, allowing for fine-tuned control over the archiving process.