Skip to content

Commit d8a8488

Browse files
Steven Drakegitster
authored andcommitted
Add a "TEMPLATE DIRECTORY" section to git-init[1].
Create a more inoformative section to describe template directory and refer to it in config.txt and with the '--template' option of git-init and git-clone commands. Signed-off-by: Steven Drake <sdrake@xnet.co.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 90b4518 commit d8a8488

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

Documentation/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,10 @@ imap::
12001200
The configuration variables in the 'imap' section are described
12011201
in linkgit:git-imap-send[1].
12021202

1203+
init.templatedir::
1204+
Specify the directory from which templates will be copied.
1205+
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
1206+
12031207
instaweb.browser::
12041208
Specify the program that will be used to browse your working
12051209
repository in gitweb. See linkgit:git-instaweb[1].

Documentation/git-clone.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ objects from the source repository into a pack in the cloned repository.
149149

150150
--template=<template_directory>::
151151
Specify the directory from which templates will be used;
152-
if unset the templates are taken from the installation
153-
defined default, typically `/usr/share/git-core/templates`.
152+
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
154153

155154
--depth <depth>::
156155
Create a 'shallow' clone with a history truncated to the

Documentation/git-init.txt

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ current working directory.
2828

2929
--template=<template_directory>::
3030

31-
Provide the directory from which templates will be used. The default template
32-
directory is `/usr/share/git-core/templates`.
33-
34-
When specified, `<template_directory>` is used as the source of the template
35-
files rather than the default. The template files include some directory
36-
structure, some suggested "exclude patterns", and copies of non-executing
37-
"hook" files. The suggested patterns and hook files are all modifiable and
38-
extensible.
31+
Specify the directory from which templates will be used. (See the "TEMPLATE
32+
DIRECTORY" section below.)
3933

4034
--shared[={false|true|umask|group|all|world|everybody|0xxx}]::
4135

@@ -106,6 +100,25 @@ of the repository, such as installing the default hooks and
106100
setting the configuration variables. The old name is retained
107101
for backward compatibility reasons.
108102

103+
TEMPLATE DIRECTORY
104+
------------------
105+
106+
The template directory contains files and directories that will be copied to
107+
the `$GIT_DIR` after it is created.
108+
109+
The template directory used will (in order):
110+
111+
- The argument given with the `--template` option.
112+
113+
- The contents of the `$GIT_TEMPLATE_DIR` environment variable.
114+
115+
- The `init.templatedir` configuration variable.
116+
117+
- The default template directory: `/usr/share/git-core/templates`.
118+
119+
The default template directory includes some directory structure, some
120+
suggested "exclude patterns", and copies of sample "hook" files.
121+
The suggested patterns and hook files are all modifiable and extensible.
109122

110123
EXAMPLES
111124
--------

0 commit comments

Comments
 (0)