Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

blackode
blackode

Posted on

     

Creating co-authored commits--command line--git

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)Photo byNeONBRAND onUnsplash

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 multipleauthors contributing the code.

You are assigned with atask and you took thehelp from one of theco-programmers to get it coded.

If you are really concerned about the help and want tocredit the co-programmer then you can do that by makingco-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 tocount 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

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>>
Enter fullscreen modeExit fullscreen mode

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.

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

The Live Execution

Hope you like them. Thanks for reading…

Join Our Telegram Channel

[https://t.me/blackoders](https://t.me/blackoders)https://t.me/blackoders

Happy Coding !

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
coolgoose profile image
Alexandru Bucur
A jack of all trades is a master of none, but oftentimes better than a master of one.
  • Location
    Netherlands
  • Work
    Messagebird
  • Joined

It's also implemented in Gitlab viathis merge. It's not technically a built in GIT feature :)

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I love coding in VIM
  • Joined

More fromblackode

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp