DEV Community

Muhammad Azeez
Muhammad Azeez

Posted on • Originally published at mazeez.dev

GitHub Party Trick

GitHub associates commits with people via email addresses. Each commit is signed with a commit and a name. So when you push a repo to GitHub, it looks for a user with that email address and associates the commit with that user. This allows some cool tricks!

You can commit as your favorite programmer in your repositories! Example:

List of contributors contains Rhyan Dhall, Rich Harris, and Linus Torvalds

In a repository, change your email address to their email address:

git config user.email "email@example.com"

Optional: Change your name to their name too!

git config user.name "Famous Person"

And now you can commit and push to GitHub. Now GitHub associates the commits with their account!

Note: The commits don't show up on their profile page. GitHub has this to say about showing commits on a user's profile:

Commits will appear on your contributions graph if they meet all of the following conditions:

  • The email address used for the commits is associated with your GitHub account.
  • The commits were made in a standalone repository, not a fork.
  • The commits were made:
    • In the repository's default branch (usually master)
    • In the gh-pages branch (for repositories with project sites)

For more information on project sites, see "About GitHub Pages."

In addition, at least one of the following must be true:

  • You are a collaborator on the repository or are a member of the organization that owns the repository.
  • You have forked the repository.
  • You have opened a pull request or issue in the repository.
  • You have starred the repository.

DISCLAIMER:

Identity theft is not a joke~

While we used this as a fun trick, it can be used for nefarious reasons. One way to workaround this issue is to cryptographically sign your commits. So that people can be sure that you have made the commits.

Top comments (1)

Collapse
 
mellen profile image
Matt Ellen-Tsivintzeli

And this is why it's important to sign your commits!

Also, use the github-noreply email address to hide your real email address