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

dotfiles in git template dir are not copied

From
greg0ire <postmaster@greg0ire.fr>
Date
Feb 17, 2017, 09:31 UTC
Message-ID
<ebd661c3-7d99-54d2-dda9-09c4a76cfe93@greg0ire.fr>
Hi,

I noticed yesterday that dotfiles inside the directory configured in init.templatedir are not copied when creating a new repository.

Here is the line I think is responsible for this behavior : https://github.com/git/git/blob/master/builtin/init-db.c#L48

Is it a bug or a feature?
Steps to reproduce, provided you already have a template dir configured :

cd $(git config --path --get init.templatedir) touch copied touch .not_copied cd /tmp mkdir whatever cd whatever git init ls -la .git

On my machine, the last command does not list .not_copied .

-- greg0ire

Next: Jeff King
Message 1 of 12 in “dotfiles in git template dir are not copied”
  1. greg0ireFeb 17, 2017
  2. Jeff KingFeb 17, 2017
  3. Grégoire PARISFeb 17, 2017
  4. Junio C HamanoFeb 17, 2017
  5. Grégoire PARISFeb 17, 2017
  6. Junio C HamanoFeb 17, 2017
  7. Grégoire PARISFeb 17, 2017
  8. Philip OakleyFeb 17, 2017
  9. Grégoire PARISFeb 17, 2017
  10. Junio C HamanoFeb 17, 2017
  11. Grégoire PARISFeb 17, 2017
  12. Grégoire PARISFeb 17, 2017

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.