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

Re: git init with template dir

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 12, 2015, 15:27 UTC
Message-ID
<xmqqioatdk0z.fsf@gitster.dls.corp.google.com>
In-Reply-To
<loom.20150612T085835-977@post.gmane.org>
Alex Cornejo <acornejo@gmail.com> writes:
> I was surprised to see that when using git-init, if the template folder
> is itself a symlink, then the contents of the template is NOT copied to
> the resulting git repository, but instead each individual file is
> symlinked.
Hmmm, I do not seem to be able to do this, though.
        $ ln -s $HOME/g/share/git-core/templates /var/tmp/git-template
        $ cd /var/tmp
	$ git init --template=/var/tmp/git-template new
        $ find new/.git -type l
        ... nothing ...
Show 7 quoted lines
> For my particular use case, this is undesirable (since if I am not
> careful, then when I change the hook of one git repo, it
> actually changes the hooks of all other repos too). It is easy
> enough for me to work around this (i.e. by instead pointing my gitconfig
> to use a template dir which is not a symlink), but I was
> wondering weather this is a feature folks use (and for what end), or if
> this is unintended behavior.

That you had to predicate "this is undesireable" with "For my particular use case" tells me that other people may want to see that these things shared and automatically receive updates when the originals in the temporate directory are updated, which makes it sound like a "feature" not an "unintended behaviour", at least to me.

Previous: Alex CornejoNext: Alex Cornejo
Message 2 of 4 in “git init with template dir”
  1. Alex CornejoJun 12, 2015
  2. Junio C HamanoJun 12, 2015
  3. Alex CornejoJun 12, 2015
  4. Junio C HamanoJun 12, 2015

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.