How to tell git to use the correct identity (name and email) for a given project?
问题 I use my personal laptop for both work and personal projects and I would like to use my work email address for my commits at work (gitolite) and my personal email address for the rest (github). I read about the following solutions which are all either global or temporary: git config --global user.email "bob@example.com" git config user.email "bob@example.com" git commit --author "Bob <bob@example.com>" setting one of the GIT_AUTHOR_EMAIL , GIT_COMMITTER_EMAIL or EMAIL environment variables