Stephen Emslie
Stephen Emslie

Reputation: 11015

Is there a way to override a git author's display name in local repository config?

I have a git repository imported from subversion where users have names like H1234567. When I run git log or git blame I'd prefer to see dave than H1234567.

Can a specific author's name be overridden in config so that all git tools will display the custom name? Alternatively perhaps there is a way to achieve this with gettext? Ideas welcome.

Upvotes: 2

Views: 377

Answers (1)

CharlesB
CharlesB

Reputation: 90496

You can do this with a mailmap file, which can translate authors' name and email without modifying history.

Create a file .mailmap at the repository root with the following:

dave <[email protected]>    H1234567 <[email protected]>

You can set different email address, or keep the original one.

See Documentation/mailmap.txt for more.

Upvotes: 5

Related Questions