Earn it: GitHub Achievements Academy home

Lesson 4: Pair Extraordinaire

Badge: co-author commits in merged pull requests.

TierCo-authored merged PRs
Base1
Bronze10
Silver24
Gold48

The real skill: pair programming and giving credit

When two people write code together, whether on a call, at one keyboard, or by passing a branch back and forth, Git can credit both of them. You add a Co-authored-by trailer at the end of the commit message:

feat: add dark mode toggle

Implemented together during Friday's pairing session.

Co-authored-by: Sam Rivera <12345678+samrivera@users.noreply.github.com>

Rules for the trailer:

  • It goes at the very end of the message, after a blank line.
  • One trailer per co-author.
  • The email must be one that's linked to their GitHub account. Their no-reply address is the safest choice. Ask them for it, or find it in one of their existing commits.

Exercise: pair for real

  1. Find a partner: a coworker, a friend, or someone from this repo's Discussions. Post in General with the title Looking for a pair and say which repo or task you'd like to work on.
  2. Pick a small, real task in either of your repos, like a feature, a test or a doc page.
  3. Work on it together over a screen share. Take turns driving.
  4. Commit with the trailer:
    git commit -m "docs: add install guide" -m "Co-authored-by: Name <id+user@users.noreply.github.com>"
  5. Open a PR and merge it. Both of you get credit once it's merged.

In the GitHub web editor, you can add co-authors when committing. VS Code and GitHub Desktop also have co-author fields.

Honesty check Only add people who actually contributed to that change. Crediting someone who didn't help, or yourself through an alt account, falsifies authorship. That's the kind of inauthentic activity FAIR-PLAY.md covers.

What you learned

  • Git trailers and commit message structure
  • Pair programming etiquette
  • Proper credit in collaborative work

Next: Lesson 5: Galaxy Brain

Check what you learned

1. Where does the Co-authored-by trailer go?
2. Which email should you use for a co-author?
3. Who should you list as a co-author?

Show the answers
  1. At the very end of the commit message, after a blank line: Trailers must sit at the end of the message, separated from the body by a blank line.
  2. One linked to their GitHub account, like their no-reply address: GitHub can only credit them if the email belongs to their account.
  3. Only people who actually contributed to that change: Crediting people who didn't contribute falsifies authorship.

Your progress is saved in this browser only.

Last reviewed November 2026. Improve this page on GitHub. Every fix you send counts toward Pull Shark.