git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [External] Document ability to disable template directory in git-init

From
Han Young <hanyang.tony@bytedance.com>
Date
Jul 4, 2025, 02:49 UTC
Message-ID
<CAG1j3zEiD341X-_ZdR2puaEmZZ0ZBWSmyboyyGZaDXcDTcmAeA@mail.gmail.com>
In-Reply-To
<boris.20250703161436@codesynthesis.com>
On Thu, Jul 3, 2025 at 10:51 PM Boris Kolpackov <boris@codesynthesis.com> wrote:
> Looking at the code, this undocumented (AFAICS) behavior appears to
> be there at least from git 2.1:
Digging through the changelog, I think the feature is added in v1.5.6.4:
 "git init --template=" with blank "template" parameter linked files
 under root directories to .git, which was a total nonsense.  Instead, it
 means "I do not want to use anything from the template directory".
Show 6 quoted lines
> I would like to suggest that we document this behavior so that it can
> be relied upon. The motivation for omitting the default template are
> repositories created by tools, such as package managers, for the sole
> purpose of fetching some information from remotes. In this case all
> the stuff copied from the template (such as hooks) is an unnecessary
> waste of time and space.

I've seen some package managers pass "--template=" to git-clone, I'd say this is a widely used undocumented feature :P Document the behavior would help people understand the existing usages of --template=

Thanks.
Previous: Boris KolpackovNext: Boris Kolpackov
Message 2 of 7 in “Document ability to disable template directory in git-init”
  1. Boris KolpackovJul 3, 2025
  2. Han YoungJul 4, 2025
  3. Boris KolpackovJul 4, 2025
  4. Todd ZullingerJul 4, 2025
  5. Jeff KingJul 6, 2025
  6. Kristoffer HaugsbakkJul 4, 2025
  7. Kristoffer HaugsbakkJul 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.