Global post-checkout hook to automatically set local user configuration of a repo, when cloning from a specific host
-
Enable Git hooks globally:
git config --global init.templatedir '~/.git-templates'
-
Create the post-checkout hook
mkdir -p ~/.git-templates/hooks cp post-checkout ~/.git-templates/hooks/post-checkout chmod +x ~/.git-templates/hooks/post-checkout
-
Edit the hook-file to insert your credentials and specific host
vim ~/.git-templates/hooks/post-checkout