Creating co-authored commits--command line--git
Tags: git, programming, coding, commits
Published: 2018-12-07 08:41:33

---
title: Creating co-authored commits--command line--git
published: true
description: This article comprises of creating a git commit with multiple authors.
tags: [git, programming, coding, commits]
---

![Photo by [NeONBRAND](https://unsplash.com/photos/mqoLpeeYBic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/thanking-co-worker?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)](https://cdn-images-1.medium.com/max/10368/1*Hgp04st2WJ0oFDnR3ED1QA.jpeg)*Photo by [NeONBRAND](https://unsplash.com/photos/mqoLpeeYBic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/thanking-co-worker?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)*


Give Credits ⭐️ whoever deserves

## Brief Story

Suppose, you are working on a project which uses the git tool for version management and it is a team project where you see multiple **authors** contributing the code.

You are assigned with a **task** and you took the **help** from one of the **co-programmers** to get it coded.

If you are really concerned about the help and want to **credit the co-programmer** then you can do that by making **co-author-commit**.

# *Giving credits to the programmer is sure of another help from him — blackode*

## Things to know Before adding a co-author to a commit

1. Co-author Email
2. Co-author’s commit to **count as a contribution-use** email associated with their Github account
3. If co-author’s email is private, use their GitHub-provided no-reply email to protect their privacy.

## TIP

### Helping Co-author to find their no-reply email and get shared

settings > emails

![no-reply github email finding](https://cdn-images-1.medium.com/max/2000/1*UzCb4YG21OVWcaYvWkNi6g.gif)

## Co-authored-by commits

Here no things are unknown to you. But, we are doing things differently.

Just like you do for a regular commit message and after adding the meaningful description you need to add two empty new lines instead of adding a closing quotation " .

```
git commit -m "New style of coding
>
>
```

![](https://cdn-images-1.medium.com/max/3812/1*pHLOMkCghw4KtEBq01BKSw.png)

On the next line of the commit message, type 
`Co-authored-by: author-name <name@xxx.com>` with specific information for each co-author. After the co-author information, add a closing quotation mark.

### Adding multiple co-authors

Give each co-author their own line and Co-authored-by: commit trailer before closing quotation mark.

![](https://cdn-images-1.medium.com/max/3810/1*LxekoycPfAO68WeWPCcnaA.png)

After adding your beautiful commit message, in the next push, the message appears with co-authors

![](https://cdn-images-1.medium.com/max/3794/1*lPELsnwpAXCtI1p24_9ksg.png)

## The Live Execution

![](https://cdn-images-1.medium.com/max/2000/1*-5aw23mL1uOH2TkVABs1HQ.gif)

Hope you like them. Thanks for reading…

## Join Our Telegram Channel

![[https://t.me/blackoders](https://t.me/blackoders)](https://cdn-images-1.medium.com/max/2000/1*gpCp7vuRX80aWxRQy7sWVA.png)*[https://t.me/blackoders](https://t.me/blackoders)*

**Happy Coding !**