aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-archive.txt
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-05-28 16:11:12 -0700
committerJunio C Hamano <gitster@pobox.com>2022-05-30 23:07:22 -0700
commit237a1d138c4322a7e934f129dee02e2ea6a214cd (patch)
tree72146e883c5056136fdf0aabddd1160f9cf55747 /Documentation/git-archive.txt
parent23f2356fd902434a9b8e9e4cdae735f399c16ff0 (diff)
downloadgit-237a1d138c4322a7e934f129dee02e2ea6a214cd.tar.gz
archive: optionally add "virtual" files
With the `--add-virtual-file=<path>:<content>` option, `git archive` now supports use cases where relatively trivial files need to be added that do not exist on disk. This will allow us to generate `.zip` files with generated content, without having to add said content to the object database and without having to write it out to disk. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> [jc: tweaked <path> handling] Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-archive.txt')
-rw-r--r--Documentation/git-archive.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 94519aae23..b41cc5bc2e 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -51,7 +51,7 @@ OPTIONS
--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`.
+ value gets used by `--add-file` and `--add-virtual-file`.
-o <file>::
--output=<file>::
@@ -63,6 +63,17 @@ OPTIONS
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 of the file in the archive is built
+ by concatenating the value of the last `--prefix` option (if any)
+ before this `--add-virtual-file` and `<path>`.
++
+The `<path>` cannot contain any colon, 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.
+
--worktree-attributes::
Look for attributes in .gitattributes files in the working tree
as well (see <<ATTRIBUTES>>).