4 ms·
Exactly, have a similar setup, I would recommend against using the approach suggested in the post if you want to be 100% sure of always using the right account.
by Copenjin 7y ago
Exactly, have a similar setup, I would recommend against using the approach suggested in the post if you want to be 100% sure of always using the right account.
- lloeki 7y agoThe article guarantees that by: - requiring a user to be set - not having one filled in the global settings The upside is that even if the folder is moved, the user config still applies. The downside is that you have to set it per repository (but only once). There are pros and cons, but I don't see one being any better or worse than the other in absolute terms.
- rkangel 7y agoThis 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.