Skip to content

Instantly share code, notes, and snippets.

@LucasLarson
Last active April 3, 2022 18:27
Show Gist options
  • Save LucasLarson/fcea3c4301ec5100460ac571a5fe99c4 to your computer and use it in GitHub Desktop.
Save LucasLarson/fcea3c4301ec5100460ac571a5fe99c4 to your computer and use it in GitHub Desktop.
How to create a homemade `.mailmap` file

How to create a homemade .mailmap file

  1. copy one from someone whose work you trust so you know the format
command curl --location --remote-name \
  'https://web.archive.org/web/0id_/github.com/wincent/wincent/raw/f2598a0cdc/.mailmap'
  1. list all names and email addresses in your repository’s commit history
command git log --pretty='%an <%ae>%n%cn <%ce>' |
  LC_ALL='C' command sort -u
  1. then keep editing .mailmap until satisfied with the output of the following command
command git shortlog --summary --numbered --email --all |
  command cut -f 2 |
  LC_ALL='C' command sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment