From ec8e42556183ff2c92aeb89a4fee92e246c46f08 Mon Sep 17 00:00:00 2001 From: Finn Bayer Date: Sun, 29 Nov 2020 00:52:55 +0100 Subject: [PATCH] added init-templatedir example windows cmd/ps added example which uses windows environment variables instead of the ~ --- index.mako | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.mako b/index.mako index d80c6585..271f6472 100644 --- a/index.mako +++ b/index.mako @@ -949,6 +949,18 @@ git config --global init.templateDir ~/.git-template pre-commit init-templatedir ~/.git-template ``` +For Windows cmd.exe use `%HOMEPATH%` instead of `~`: + +```batch +pre-commit init-templatedir %HOMEPATH%\.git-template +``` + +For Windows PowerShell use `$HOME` instead of `~`: + +```powershell +pre-commit init-templatedir $HOME\.git-template +``` + Now whenever a repository is cloned or created, it will have the hooks set up already!