Add files to
%UserProfile%/.gitconfig-MyOtherOrganization
%UserProfile%/.gitconfig
- only if you want to use git precommit hook
%UserProfile%\.git\templates\hooks\pre-commit
[user] | |
email = patrik.svikruha@gmail.com | |
name = Patrik Svikruha | |
[credential] | |
helper = wincred | |
[filter "lfs"] | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process | |
required = true | |
clean = git-lfs clean -- %f | |
[core] | |
editor = code --wait | |
[merge] | |
tool = bc | |
[mergetool "bc"] | |
path = C:/Program Files/Beyond Compare 4/BCompare.exe | |
[mergetool] | |
keepBackup = false | |
[difftool "sourcetree"] | |
cmd = '' \"$LOCAL\" \"$REMOTE\" | |
[mergetool "sourcetree"] | |
cmd = "'' " | |
trustExitCode = true | |
[includeIf "gitdir:~/MyOtherOrganization/"] | |
path = .gitconfig-MyOtherOrganization |
[user] | |
email = patrik.svikruha@myotherorganization.com |
#!/bin/sh | |
PWD=`pwd` | |
if [[ $PWD == *"MyOtherOrganization"* ]] | |
then | |
EMAIL=$(git config user.email) | |
if [[ $EMAIL == *"myotherorganization | |
.cz"* ]] | |
then | |
echo ""; | |
else | |
echo "Wrong email for myotherorganization project"; | |
echo "run:" | |
echo ' git config user.email "svikruha@myotherorganization.cz"' | |
echo '' | |
exit 1; | |
fi; | |
elif [[ $PWD == *"\PersonalProjects"* ]] | |
then | |
EMAIL=$(git config user.email) | |
if [[ $EMAIL == *"gmail.com"* ]] | |
then | |
echo ""; | |
else | |
echo "Wrong email for personal project"; | |
echo "run:" | |
echo ' git config user.email "patrik.svikruha@gmail.com"' | |
echo '' | |
exit 1; | |
fi; | |
fi; |