Merge branch 'rs/document-archive-prefix' into js/scalar-diagnose

* rs/document-archive-prefix:
  archive: improve documentation of --prefix
This commit is contained in:
Junio C Hamano 2022-05-28 10:38:06 -07:00
commit 23f2356fd9

View File

@ -49,7 +49,9 @@ OPTIONS
Report progress to stderr. Report progress to stderr.
--prefix=<prefix>/:: --prefix=<prefix>/::
Prepend <prefix>/ to each filename in the archive. 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>:: -o <file>::
--output=<file>:: --output=<file>::
@ -57,9 +59,9 @@ OPTIONS
--add-file=<file>:: --add-file=<file>::
Add a non-tracked file to the archive. Can be repeated to add 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 multiple files. The path of the file in the archive is built by
by concatenating the value for `--prefix` (if any) and the concatenating the value of the last `--prefix` option (if any)
basename of <file>. before this `--add-file` and the basename of <file>.
--worktree-attributes:: --worktree-attributes::
Look for attributes in .gitattributes files in the working tree Look for attributes in .gitattributes files in the working tree
@ -194,6 +196,12 @@ EXAMPLES
commit on the current branch. Note that the output format is commit on the current branch. Note that the output format is
inferred by the extension of the output file. 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"`:: `git config tar.tar.xz.command "xz -c"`::
Configure a "tar.xz" format for making LZMA-compressed tarfiles. Configure a "tar.xz" format for making LZMA-compressed tarfiles.