DEV Community

julia ferraioli
julia ferraioli

Posted on

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!

Discussion (0)