オレオレgitテンプレートの定義
$ tree $HOME/work/.git_template
/home/XXX/work/.git_template
-- hooks
-- post-flow-release-finish
`-- post-flow-release-start
`-- info
`-- exclude
2 directories, 3 files
git clone OR git init
- -template オプションでtemplateディレクトリを指定 (git init --template=$HOME/work/.git_template)
- 環境変数で指定(export GIT_TEMPLATE_DIR=$HOME/work/.git_template)
- .gitconfigで指定(git config --global init.templatedir $HOME/work/.git_template)
適用例
/tmp$ rm -rf test
/tmp$ mkdir test
/tmp$ cd test
/tmp/test$ touch a
/tmp/test$ git init --template=$HOME/work/.git_template
Initialized empty Git repository in /tmp/test/.git/
/tmp/test$ tree . .git
.
`-- a
.git
-- HEAD
-- config
-- hooks
-- post-flow-release-finish
`-- post-flow-release-start
-- info
`-- exclude
-- objects
-- info
`-- pack
`-- refs
-- heads
`-- tags
8 directories, 6 files
/tmp/test$