Creating a new commit
Before starting to develop with Git, you should introduce yourself with a name and an email, as shown in Chapter 1, Git Basics in Practice. This information will be used to identify your work, either as an author or as a committer. The setup can be global for all your repositories (with git config --global
, or by editing the ~/.gitconfig
file directly), or local to a repository (with git config
, or by editing the .git/config
file inside the given repository). The per-repository configuration overrides the per-user one (you will learn more about this in Chapter 13, Customizing and Extending Git).
Multiple identities
You might want to use your company email for work repositories, but your own, non-work email for public repositories you work on. This can be done by setting one identity globally (for the user) and using the local repository config for setting an alternate identity for exceptions. Another possible solution would be to use conditional includes...