
It can be annoying hitting the fatal: unable to auto-detect email address error message when you’re anxious to commit code to the local repository. The command to set the local git config email and username is as follows: git config -global user.email " " git config -global user.name "cameronmcnz" This is the cascading nature of git config. Worktree overrides local, local overrides global and globel overrides system. If you want to use a special name or email address for a specific Git repo, you can set the git config email and username fields at the local or worktree scope. Git allows you to set variables at the system, global, local and workingtree level.

The administrators on the DevOps team might not be impressed by such antics, but it will at least allow you to perform your commits without anxiety over privacy concerns. They don’t get used as part of a marketing campaign.įurthermore, the git config email is not validated, so you can give it an address that is made up or malformed. That’s all the git config user.name and user.email properties are used for. Anyone looking through the Git log needs the ability to see who squashed a commit, performed a branch rebase, merged some code, added a Git tag or performed a commit. It’s only use is to provide substance to the author metadata that is attached to every commit. The Git config email is not harvested for marketing purposes. As such, some are leery about providing their email to Git config. After all, nobody wants to be be spammed with unsolicited email. Privacy minded people aren’t wont to just hand over their email address every time an app or service asks for it. Verify your git config email and username settings with the –list switch.
