GIT .mailmap适用于每个回购协议,但不是全局的,为什么? [英] GIT .mailmap works per repo, but not in global, why?
问题描述
我的.mailmap文件适用于所有的回购协议,当它处于每一个的根。
我试图将文件放在我的〜/ .gitconfig文件中,但它不起作用。我使用Git for Windows
,并在我的全局.gitconfig文件中添加了这个:
>> git config --global mailmap.file〜/ .mailmap
这就是我使用的命令。
[log]
mailmap =〜/ .mailmap
[mailmap ]
file = C:/ Documents and Settings /< username> /。mailmap
两者都导致相同的文件位置,但在使用git-shortlog时似乎并不尊重这个文件
有什么建议吗?
谢谢。
编辑
从来没有在git上使用它。我的黑客修复工作是将邮件地图文件保存在数据库中,并用脚本将其写入每个存储库。
.gitconfig
,我发现所有的windows路径都是用两个反斜杠写的,比如 [difftoolkdiff3]
path = C:\\程序文件\\KDiff3\\kdiff3.exe
这适用于我。
也许你应该写 p>
[mailmap]
file = C:\\ Documents and Settings\\< username> \ \.mailmap
让事情顺利进行。或者,您可以尝试使用git样式的路径声明,如
$ p $ [mailmap]
file = / c / Documents \ and\ Settings /< username> /。mailmap
I have a group of repos and I have a .mailmap file to combine user names.
My .mailmap file works for all the repos, when it is in the root of each.
I tried to put the file in my ~/.gitconfig file and it doesn't work. Im using Git for Windows and in my global .gitconfig file I added this:
>> git config --global mailmap.file "~/.mailmap"
Thats the command I used. Also tried the log shown below.
[log]
mailmap = ~/.mailmap
[mailmap]
file = C:/Documents and Settings/<username>/.mailmap
Both lead to the same file location, but it doesn't seem to honor this file when using git-shortlog
Any suggestions? Thanks.
EDIT Never did git this to work on windows. My hack-fix was to keep the mailmap file in the database, and to write it to each repository with a script.
Looking into my .gitconfig
, I see that all the windows paths are written with two backslashes like
[difftool "kdiff3"]
path = C:\\Program Files\\KDiff3\\kdiff3.exe
This works for me.
Maybe you should write
[mailmap]
file = C:\\Documents and Settings\\<username>\\.mailmap
to get things working. As an alternative, you could try the git-style path declaration like
[mailmap]
file = /c/Documents\ and\ Settings/<username>/.mailmap
这篇关于GIT .mailmap适用于每个回购协议,但不是全局的,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!