简体   繁体   中英

Share .mailmap or other top-level files between multiple Git repositories, cross-platform

I have a number of Git repositories with similar contributors. Over the lifetime of those repositories, most contributors have used a variety of email addresses, etc. As such, each repository has a .mailmap file to facilitate git shortlog -s -e .

Because these .mailmap files are nearly identical to each other, the existing situation is not DRY . And each time a contributor adopts a new email address or suchlike, a new alias needs to be added across all the .mailmap files in all the repositories they are contributing to.

I would like to factor the .mailmap files out into a single repository (let's call it mailmap ), so that new aliases only need to be added in one place, that will propagate to all the other repositories.

Using a git submodule called mailmap , with a symbolic link in each other repository from .mailmap to mailmap/.mailmap , seems like a reasonable option, but will the symbolic link work on Windows? Ie will git shortlog -s -e show the same thing on Windows as it does on POSIX systems? (The current contributors don't use Windows, but Windows users might clone the Git repositories, and we want git shortlog -s -e to work for them as well as it works for us.)

If not, what might be a better solution?

To make the symbolic links work on Windows, there are several possibilities, including:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM