Skip to content

Commit 9b4c8b0

Browse files
committed
archive documentation: attributes are taken from the tree by default
By default, git-archive takes attributes from the tree being archived. People however often wonder why their attempts to affect the way how the command archives their tree by changing .gitattributes in their work tree fail. Add a bit of explanatory note to tell them how to achieve what they want to do. Noticed-by: Francois Marier Signed-off-by: Junio C Hamano <[email protected]>
1 parent f937421 commit 9b4c8b0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Documentation/git-archive.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ export-subst::
112112
expand several placeholders when adding this file to an archive.
113113
See linkgit:gitattributes[5] for details.
114114

115+
Note that attributes are by default taken from the `.gitattributes` files
116+
in the tree that is being archived. If you want to tweak the way the
117+
output is generated after the fact (e.g. you committed without adding an
118+
appropriate export-ignore in its `.gitattributes`), adjust the checked out
119+
`.gitattributes` file as necessary and use `--work-tree-attributes`
120+
option. Alternatively you can keep necessary attributes that should apply
121+
while archiving any tree in your `$GIT_DIR/info/attributes` file.
122+
115123
EXAMPLES
116124
--------
117125
git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)::

0 commit comments

Comments
 (0)