check-mailmap Git Command Guide
The git check-mailmap command is used to show canonical names and email addresses of contacts by looking up the person’s proper name and email address from .mailmap entries. If the canonical information is found, it’s printed; otherwise the input is shown as-is.
git check-mailmap Syntax:
Section titled “git check-mailmap Syntax:”git check-mailmap [<options>] <contact>...Options:
Section titled “Options:”| Option | Description |
|---|---|
| —stdin | Read contacts, one per line, from the standard input after exhausting contacts provided on the command-line |
| —mailmap-file= | In addition to any configured mailmap files, read the specified mailmap file |
| —mailmap-blob= | Like —mailmap-file, but consider the value as a reference to a blob in the repository |
Parameters:
Section titled “Parameters:”| Parameter | Description |
|---|---|
| Contact information in formats like “Name user@host”, “user@host”, or “user@host” |
git check-mailmap Command Samples:
Section titled “git check-mailmap Command Samples:”Check a single contact
Section titled “Check a single contact”git check-mailmap "John Doe <john@example.com>"Looks up the canonical form of the given contact.
Check multiple contacts
Section titled “Check multiple contacts”git check-mailmap user@domain.com "Jane Smith <jane@test.org>"Processes multiple contacts and shows their canonical forms.
Read from stdin
Section titled “Read from stdin”echo "alias@example.com" | git check-mailmap --stdinReads contact from standard input.
Use custom mailmap file
Section titled “Use custom mailmap file”git check-mailmap --mailmap-file=.mailmap new@example.comUses a specific mailmap file for lookups.
Check from repository blob
Section titled “Check from repository blob”git check-mailmap --mailmap-blob=HEAD:.mailmap dev@company.comUses a blob in the repository as the mailmap source.
How do I check the canonical form of an email address?
Section titled “How do I check the canonical form of an email address?”To check the canonical form of an email address, use:
git check-mailmap <email>How can I check multiple contacts?
Section titled “How can I check multiple contacts?”To check multiple contacts, run:
git check-mailmap <contact1> <contact2>...How do I use stdin with git check-mailmap?
Section titled “How do I use stdin with git check-mailmap?”To use stdin with git check-mailmap, execute:
echo "<contact>" | git check-mailmap --stdinHow can I specify a custom mailmap file?
Section titled “How can I specify a custom mailmap file?”To specify a custom mailmap file, use:
git check-mailmap --mailmap-file=<file> <contact>How do I use a blob as mailmap source?
Section titled “How do I use a blob as mailmap source?”To use a blob as mailmap source, run:
git check-mailmap --mailmap-blob=<ref>:<path> <contact>Applications of the git check-mailmap command
Section titled “Applications of the git check-mailmap command”- Verifying .mailmap configurations for accurate contributor identification
- Standardizing author and committer names in commit history analysis
- Checking canonical contact information before commiting changes to .mailmap
- Debugging mailmap rules during repository maintenance
- Validating email address mappings for proper attribution in git stats
- Testing mailmap transformations before global implementation
- Resolving contributor identity inconsistencies across different Git operations