Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Created April 17, 2015 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo0107/db07d64898cc4b6418ed to your computer and use it in GitHub Desktop.
Save kenzo0107/db07d64898cc4b6418ed to your computer and use it in GitHub Desktop.
# gitリポジトリのトップ階層へ移動
cd `git rev-parse --show-toplevel`
# hook sh配置用ディレクトリ作成
mkdir -p .git_template/hooks
# pre-commit作成
vim .git_template/hooks/pre-commit
# pre-commitに実行権限付与
chmod 755 ~/.git_template/hooks/pre-commit
# git configに設定
git config --global init.templatedir '~/.git_template'
# .git/hooks/pre-commit作成済みの場合、リネーム
mv .git/hooks/pre-commit ./git/hooks/pre-commit.backup
# hooks再インストール/pre-commitの設定反映
git init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment