How to configure Git email

Configuring your Git email ensures proper commit authorship and maintains accurate project history for team collaboration and code attribution. As the creator of CoreUI, a widely used open-source UI library, I’ve configured Git email settings for thousands of contributors across our development teams and open-source projects. From my expertise, the most effective approach is setting a global email with repository-specific overrides when needed for different contexts. This method provides consistent identity across projects while allowing flexibility for work and personal repositories.

Use git config --global user.email to set your email globally for all repositories.

# Set global email (recommended)
git config --global user.email '[email protected]'

# Set email for current repository only
git config user.email '[email protected]'

# Verify current configuration
git config --get user.email

# View all email settings
git config --list | grep email

# Check both global and local settings
git config --global --get user.email
git config --local --get user.email

The --global flag sets the email for all repositories on your system, while omitting it sets it only for the current repository. Git uses this email information along with your username to identify commit authors. Always verify your configuration before making commits to ensure proper attribution.

Best Practice Note:

This is the same Git email configuration approach we use in CoreUI development workflows for proper commit attribution. Use work email for professional repositories and personal email for open-source contributions to maintain clear identity separation.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author