DEV Community

julia ferraioli
julia ferraioli

Posted on

3 2

Why your git email address matters

Cross-posted from juliaferraioli.com

When you were getting started with open source – and especially with git, you probably ran across guidance that told you to run commands such as this:

$ git config --global user.name "Your Name"

$ git config --global user.email yourname@example.com
Enter fullscreen mode Exit fullscreen mode

to set your git username and email address.

It's an easy way to make sure that whichever repository you're contributing to, and wherever its canonical source lives, your commits are associated with you. Effectively signing your name or open source identity to your commits is a Good Thing™, because it allows the project to identify recurring contributors, (selfishly) provides people like me a way to do some analysis on git data, and more.

That said, the email address that you use matters.

We all operate in different contexts. I have personal, volunteer, side-project, and corporate contexts – and different email addresses associated with each of them. The email address that I use for a specific commit tells the project in which context my contribution has been made.

So in addition to (or instead of) running setting a global configuration for your email address, you can run:

$ git config user.email yourname@company.com
Enter fullscreen mode Exit fullscreen mode

within your clone of a specific repository to configure the email address that your commits should use. If you have set a global user.email as well, that's what commits will use if you haven't set one within a repository (git-scm documentation that describes this behavior).

As open source gains traction in nearly all (quite possibly all) industries with more companies and organizations contributing back to open source projects they use (also a Good Thing™), it is important to signal under which context people are contributing. Am I being a good open source citizen by fixing bugs in a framework that my employer uses? Am I trying to improve a library that opensourcestories.org uses? Or am I contributing because I find the project interesting?

These are some possible scenarios where the additional information provided by your commit's email address can give maintainers more insight into your motivations.

It's a bit more work for you, but transparency is a core value of open source. Be transparent about your affiliation, and be thoughtful about your email address!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay