How to add multiple authors to a commit in Github
Tags: git, github, productivity, tutorial
Published: 2023-04-03 15:37:41

---
title: How to add multiple authors to a commit in Github
published: true
date: 2023-04-03 09:00:52 UTC
tags: git, github, productivity, tutorial
canonical_url: https://gitbetter.substack.com/p/how-to-add-multiple-authors-to-a
---


![multiple authors to a commit in github](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F377a4807-a783-44b8-a614-02f5ff41c8eb_1024x666.webp)

> #### This post was originally posted in the newsletter [GitBetter](https://gitbetter.substack.com/). If you are interested in leveling up your game in Git, you can subscribe to it.

Github supports to add multiple authors to a single commit.

This feature is helpful when developers do pair programming. So it will be clear who contributed to the commit. And their contribution gets attribution in the pull request and in their contribution graph.

And moreover adding co-authors is so simple.

--

#### Adding co-authors

You have to mention the author’s info in the commit message as below.

```
<Commit message>

Co-authored-by: Jon Snow <jon@gmail.com>
Co-authored-by: Tyrian <tyrian@users.noreply.github.com>
```

In the above snippet, you can see we should add **Co-authored-by` `** label. You can add multiple authors as you need.

And remember you should leave at least one line of white space.

Sometimes the author’s email address won’t be public. So Github will be providing a private email address to that user. You can use that email address too for privacy reasons.

You can see I have used a private email address for the user **Tyrian**

![github co-author](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F60eaa186-39b4-4e0d-b805-b71942ee40de_682x326.png)

--

In the above image, you can see I’m adding a co-author.

![github co-author](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd41cb11-c65f-4a13-8165-344fc89f6628_612x191.png)

And in Github you can see it’s showing two authors have contributed to the commit.

--

#### Using vs-code extension

If you are using vs-code then adding co-authors is much more simpler.

**[Git Co-Authors](https://marketplace.visualstudio.com/items?itemName=drrouman.git-coauthors)** is a handy vs-code extension you can use to add co-authors to your repo.

![github co-authors](https://cdn.substack.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4f690b98-f373-4b24-a0b4-b2e6af9a5301_569x267.gif)

--

#### git-coauthor - Simple multiple author support porcelain for git


I found another helpful tool **[git-coauthor](https://github.com/simoleone/git-coauthor)** which is very lightweight tool written in bash.

The usage is very simple. You can add co-authors to a list and use them as appropriate.

And it also has option to switch to solo commits and to co-authors commits easily. This is one of my personal favorite.

Github support for co-authors is a useful feature you can start using. And it comes in handy when you do pair programming.

> #### This post was originally posted in the newsletter [GitBetter](https://gitbetter.substack.com/). If you are interested in leveling up your game in Git, you can subscribe to it.