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

Re: Suggestion: Enhance git init with Language-Specific Templates

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 5, 2025, 22:52 UTC
Message-ID
<xmqq1pvbks3i.fsf@gitster.g>
In-Reply-To
<Z8jTjt1CQ7hp8KSP@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 8 quoted lines
> What Git _does_ provide is a way to create a template of objects that
> should be in the `.git` directory using the `--template` option.  It's
> possible to create a template that contains an initial commit with a
> `.gitignore` file.  I personally would not recommend this approach,
> since it will not work gracefully with alternate ref formats or hash
> algorithms, but it is an option for people who want to use it.  This was
> in common use for setting up the default branch name before `git init`
> added the `-b` option and it's related config, so it is well tested.

I wouldn't have thrown objects in the --template directory, and I wouldn't count on things outside what the mechanism was invented for (namely, .git/hooks and possibly .git/info/ files) would forever be copied in newer versions of Git, but certainly "git init --template" mechanism sounds like a good escape hatch than mucking with Git code base to teach it myriad of languages and their dialects.

Thanks.
Previous: rsbecker@nexbridge.comNext: Oleg Taranenko
Message 4 of 7 in “Suggestion: Enhance git init with Language-Specific Templates”
  1. Tech KenyaMar 4, 2025
  2. brian m. carlsonMar 5, 2025
  3. rsbecker@nexbridge.comMar 5, 2025
  4. Junio C HamanoMar 5, 2025
  5. Oleg TaranenkoMar 5, 2025
  6. Junio C HamanoMar 5, 2025
  7. Oleg TaranenkoMar 6, 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.