Skip to content

git: Do not install templates when creating repos

Patrick Steinhardt requested to merge pks-git-no-templates into master

When executing git-init(1) or git-clone(1), then Git will first create the target repository and then copy all files found in a specific template directory into the target repository. The default templates, which are typically installed in "/usr/share/git-core/templates", contain example hooks, a default description and an exclude file which explains the syntax of excludes. None of these files are required at all, and they take up precious disk space without serving any immediate purpose.

Furthermore, an upcoming change will give us the ability to distribute Git versions as two executables, only. As a consequence, in such a setup we wouldn't have any template directory available, which would lead Git to complain about it not having been found.

Stop installing the template directory by injecting "init.templateDir=" into both git-init(1) and git-clone(1) to prepare for this change and stop wasting disk space.

Changelog: changed

Part of #3730 (closed)

Closes #3285 (closed)

Edited by Patrick Steinhardt

Merge request reports