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

[PATCH 2/2] Add a "TEMPLATE DIRECTORY" section to git-init[1].

From
SDSteven Drake <sdrake@xnet.co.nz>
Date
Feb 16, 2010, 23:44 UTC
Message-ID
<alpine.LNX.2.00.1002171244160.2477@vqena.qenxr.bet.am>
In-Reply-To
<alpine.LNX.2.00.1002171242150.2477@vqena.qenxr.bet.am>

The new section is supposed to be more informative, with references to it in config.txt and with the '--template' option of git-init and git-clone.

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
---
 Documentation/config.txt    |    4 ++++
 Documentation/git-clone.txt |    3 +--
 Documentation/git-init.txt  |   29 +++++++++++++++++++++--------
 3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 8acb613..da176e4 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1181,6 +1181,10 @@ imap::
 	The configuration variables in the 'imap' section are described
 	in linkgit:git-imap-send[1].
 
+init.templatedir::
+	Specify the directory from which templates will be copied.
+	(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
+
 instaweb.browser::
 	Specify the program that will be used to browse your working
 	repository in gitweb. See linkgit:git-instaweb[1].
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 7ccd742..731b57e 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -143,8 +143,7 @@ objects from the source repository into a pack in the cloned repository.
 
 --template=<template_directory>::
 	Specify the directory from which templates will be used;
-	if unset the templates are taken from the installation
-	defined default, typically `/usr/share/git-core/templates`.
+	(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
 
 --depth <depth>::
 	Create a 'shallow' clone with a history truncated to the
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index f081b24..dcab667 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -28,14 +28,8 @@ current working directory.
 
 --template=<template_directory>::
 
-Provide the directory from which templates will be used.  The default template
-directory is `/usr/share/git-core/templates`.
-
-When specified, `<template_directory>` is used as the source of the template
-files rather than the default.  The template files include some directory
-structure, some suggested "exclude patterns", and copies of non-executing
-"hook" files.  The suggested patterns and hook files are all modifiable and
-extensible.
+Specify the directory from which templates will be used.  (See the "TEMPLATE
+DIRECTORY" section below.)
 
 --shared[={false|true|umask|group|all|world|everybody|0xxx}]::
 
@@ -106,6 +100,25 @@ of the repository, such as installing the default hooks and
 setting the configuration variables.  The old name is retained
 for backward compatibility reasons.
 
+TEMPLATE DIRECTORY
+------------------
+
+The template directory contains files and directories that will be copied to
+the `$GIT_DIR` after it is created.
+
+The template directory used will (in order):
+
+ - The argument given with the `--template` option.
+
+ - The contents of the `$GIT_TEMPLATE_DIR` environment variable.
+
+ - The `init.templatedir` configuration variable.
+
+ - The default template directory: `/usr/share/git-core/templates`.
+
+The default template directory includes some directory structure, some
+suggested "exclude patterns", and copies of non-executing "hook" files.
+The suggested patterns and hook files are all modifiable and extensible.
 
 EXAMPLES
 --------
-- 
1.6.6.208.gcaa4e.dirty
Previous: Steven DrakeNext: Junio C Hamano
Message 2 of 3 in “Add `init.templatedir` configuration variable.”
  1. 1/2 Add `init.templatedir` configuration variable.Steven Drake, Feb 16, 2010
  2. 2/2 Add a "TEMPLATE DIRECTORY" section to git-init[1].Steven Drake, Feb 16, 2010
  3. Junio C HamanoFeb 17, 2010

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.