HgGit:“无效的电子邮件地址”在GitHub上 [英] HgGit: "invalid-email-address" at GitHub

查看:216
本文介绍了HgGit:“无效的电子邮件地址”在GitHub上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用HgGit extension for mercurial在GitHub上复制存储库。几乎所有的工作都很好,但是在GitHub的提交信息中,我看到 invalid-email-address(author)而不是我的用户名。在这种情况下是否有正确显示用户名的方法?

解决方案

Mercurial中的用户名通常是以下形式:

 名称< email@domain.com> 

Git通常还会为用户设置一个名称和一个电子邮件地址。



我的猜测是您可能需要在您的Mercurial配置文件中指定用户名中的电子邮件地址,以便提交中的用户名在github上正常工作。



这个用户名不需要与您在任何特定网站的用户名相同,只是用于提交信息。如果要求它是相同的,那么您将如何能够推送其他人完成的更改集?

例如,我的bitbucket用户名与我的Mercurial用户名不同在我的提交中,以及我将bitbucket用户名和密码从repo的 hgrc 中的bitbucket路径保留的方式是使用 [auth] 我的用户部分 .hgrc / Mercurial.ini

  [auth] 
bb.prefix = bitbucket.org
bb.schemes = https
bb.username = myBBusername
b.password = myBBpassword

这里输入密码是可选的(系统会提示您) ,但存在更安全的替代方法,例如钥匙圈扩展名。



然而,在现有变更集上更改用户名有点晚了(您必须重新编写回购的整个历史记录)。


I started to use HgGit extension for mercurial to have copy of repository at GitHub. Almost everything is working well, but in commits information at GitHub I see invalid-email-address (author) instead of my username. Is there a way to show username correctly in this case?

解决方案

A username in Mercurial is usually of the form:

Name <email@domain.com>

Git also is usually set up with a name and an e-mail address for the user.

My guess is that you probably need to specify an e-mail address in your username in your Mercurial config so that the username in the commits works correctly on github.

This username is not required to be the same as your username at any particular website, it's for commit information. If it were required to be the same, how would you ever be able to push changesets done by someone else?

For example, my bitbucket username is different than my Mercurial username on my commits, and the way I keep my bitbucket username and password out of the bitbucket paths in the repo's hgrc is to use the [auth] section of my user .hgrc/Mercurial.ini:

[auth]
bb.prefix = bitbucket.org
bb.schemes = https
bb.username = myBBusername
bb.password = myBBpassword

Putting the password here is optional (you'll be prompted), but there are more secure alternatives for storing it, such as the keyring extension.

However, it's a bit late to change the username on existing changesets (you'd have to re-write the repo's entire history).

这篇关于HgGit:“无效的电子邮件地址”在GitHub上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆