Skip to content

Instantly share code, notes, and snippets.

@LucasLarson
Last active September 27, 2026 23:55
Show Gist options
  • Select an option

  • Save LucasLarson/fcea3c4301ec5100460ac571a5fe99c4 to your computer and use it in GitHub Desktop.

Select an option

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
set -- 'https://web.archive.org/web/0id_/github.com/wincent/wincent/raw/f2598a0cdc/.mailmap' && {
  curl --location --remote-name "${1?}" ||
    wget --hsts-file=/dev/null "${1?}"
}
  1. list all names and email addresses in your repository’s commit history
git log --all --format='%an <%ae>%n%cn <%ce>' |
  LANG='C' LC_ALL='C' sort -u
  1. then keep editing .mailmap until satisfied with the output of the following command
git shortlog --all --email --numbered --summary |
  cut -f 2 |
  LANG='C' LC_ALL='C' sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment