3 ms·
This setup does ensure this. These are the two relevant commands: git config --global --unset user.email (etc.) git config --global user.useConfigOnly true Thi
by rkangel 7y ago
This setup does ensure this. These are the two relevant commands:
git config --global --unset user.email (etc.)
git config --global user.useConfigOnly true
This means that there is no default email set, and that git will error if you try and commit, because there is no email set.
I do a lighter weight version of this article by just doing the above. Then when I do the first commit in a repo, I get that error and I do the following command:
git config --local user.email me@myworkemail.com
(or the my personal email as appropriate). Then I have per repo config that persists unless I blow the repo away completely.