Skip to content

Commit 87f4164

Browse files
committed
Merge branch 'jc/archive-prefix-with-add-virtual-file'
"git archive --add-virtual-file=<path>:<contents>" never paid attention to the --prefix=<prefix> option but the documentation said it would. The documentation has been corrected. * jc/archive-prefix-with-add-virtual-file: archive: document that --add-virtual-file takes full path
2 parents 5c9be4c + 72c2820 commit 87f4164

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Documentation/git-archive.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ OPTIONS
5353
--prefix=<prefix>/::
5454
Prepend <prefix>/ to paths in the archive. Can be repeated; its
5555
rightmost value is used for all tracked files. See below which
56-
value gets used by `--add-file` and `--add-virtual-file`.
56+
value gets used by `--add-file`.
5757

5858
-o <file>::
5959
--output=<file>::
@@ -67,9 +67,7 @@ OPTIONS
6767

6868
--add-virtual-file=<path>:<content>::
6969
Add the specified contents to the archive. Can be repeated to add
70-
multiple files. The path of the file in the archive is built
71-
by concatenating the value of the last `--prefix` option (if any)
72-
before this `--add-virtual-file` and `<path>`.
70+
multiple files.
7371
+
7472
The `<path>` argument can start and end with a literal double-quote
7573
character; the contained file name is interpreted as a C-style string,
@@ -81,6 +79,10 @@ if the path begins or ends with a double-quote character.
8179
The file mode is limited to a regular file, and the option may be
8280
subject to platform-dependent command-line limits. For non-trivial
8381
cases, write an untracked file and use `--add-file` instead.
82+
+
83+
Note that unlike `--add-file` the path created in the archive is not
84+
affected by the `--prefix` option, as a full `<path>` can be given as
85+
the value of the option.
8486

8587
--worktree-attributes::
8688
Look for attributes in .gitattributes files in the working tree

0 commit comments

Comments
 (0)