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

[PATCH 1/2] add --template=<template_directory> option to git-clone

From
MLMatthias Lederhofer <matled@gmx.net>
Date
May 27, 2006, 10:25 UTC
Message-ID
<24462.1924161494$1148725552@news.gmane.org>
---
a176a8eae1d0e8e87028c4185ad5500ce2845441
 Documentation/git-clone.txt |    8 ++++++--
 git-clone.sh                |    7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
a176a8eae1d0e8e87028c4185ad5500ce2845441
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index b333f51..881b464 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -9,8 +9,8 @@ git-clone - Clones a repository
 SYNOPSIS
 --------
 [verse]
-'git-clone' [-l [-s]] [-q] [-n] [--bare] [-o <name>] [-u <upload-pack>]
-	  [--reference <repository>]
+'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
+	  [-o <name>] [-u <upload-pack>] [--reference <repository>]
 	  <repository> [<directory>]
 
 DESCRIPTION
@@ -34,6 +34,10 @@ branch you are currently working on.  Re
 
 OPTIONS
 -------
+--template=<template_directory>::
+	Provide the directory from which templates will be used.
+	The default template directory is `/usr/share/git-core/templates`.
+
 --local::
 -l::
 	When the repository to clone from is on a local machine,
diff --git a/git-clone.sh b/git-clone.sh
index d96894d..1c7ae12 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -9,7 +9,7 @@ # See git-sh-setup why.
 unset CDPATH
 
 usage() {
-	echo >&2 "Usage: $0 [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
+	echo >&2 "Usage: $0 [--template=<template_directory>] [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
 	exit 1
 }
 
@@ -102,6 +102,7 @@ quiet=
 local=no
 use_local=no
 local_shared=no
+template=
 no_checkout=
 upload_pack=
 bare=
@@ -120,6 +121,8 @@ while
 	*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
         *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared) 
           local_shared=yes; use_local=yes ;;
+	*,--template=*)
+	  template="$1" ;;
 	*,-q|*,--quiet) quiet=-q ;;
 	*,--use-separate-remote)
 		use_separate_remote=t ;;
@@ -203,7 +206,7 @@ trap 'err=$?; cd ..; rm -r "$D"; exit $e
 case "$bare" in
 yes) GIT_DIR="$D" ;;
 *) GIT_DIR="$D/.git" ;;
-esac && export GIT_DIR && git-init-db || usage
+esac && export GIT_DIR && git-init-db "$template" || usage
 case "$bare" in
 yes)
 	GIT_DIR="$D" ;;
-- 
1.3.3.g40505
Message 1 of 1 in “add --template=<template_directory> option to git-clone”
  1. 1/2 add --template=<template_directory> option to git-cloneMatthias Lederhofer, May 27, 2006

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.