Внутри справочной страницы git archive
мы видим:
--worktree-attributes
Look for attributes in .gitattributes files in the working tree as well (see the section called “ATTRIBUTES”).
и
ATTRIBUTES
export-ignore
Files and directories with the attribute export-ignore won’t be added to archive files. See gitattributes(5) for details.
export-subst
If the attribute export-subst is set for a file then Git will expand several placeholders when adding this file to an archive. See gitattributes(5) for details.
… так что вы можете определить выделенный файл .gitattributes это будет соответствовать вашим потребностям.
В качестве альтернативы, нам также сказали, что:
<extra>
This can be any options that the archiver backend understands. See next section.
Так, например, если мы завершим тарбол и команда бэкенда будет tar , мы можем использовать - исключить (который является частью tar, а не git) для достижения того же, что может быть проще, чем определение всей политики Git.