The same git init
documentation has this to say about templates:
Template directory
The template directory contains files and directories that will be copied to the $GIT_DIR
after it is created.
The template directory will be one of the following (in order):
the argument given with the --template
option;
the contents of the $GIT_TEMPLATE_DIR
environment variable;
the init.templatedir
configuration variable; or
the default template directory: /usr/share/git-core/templates.
The default template directory includes some directory structure, suggested "exclude patterns" (see gitignore[5]), and sample hook files (see githooks[5]).
So if you have manually changed the files in /usr/share/git-core/templates
, or possibly upgraded to a new version of Git that came with different templates, reinitializing will copy those new files into an existing repository.
The documentation also suggests another reason for reinitializing:
to move the repository to another place if --separate-git-dir
is given
And later:
--separate-git-dir=<git dir>
Instead of initializing the repository as a directory to either $GIT_DIR
or ./.git/
, create a text file there containing the path to the actual repository. This file acts as filesystem-agnostic Git symbolic link to the repository.
If this is reinitialization, the repository will be moved to the specified path.