本文介绍了Mercurial“未提供用户名"在Mac上的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在OSX Mountain Lion Max(10.8)上安装了Mercurial,并且在第一次提交时出现错误:

abort: no username supplied (see "hg help config")

我看到了很多答案,这些提示建议我需要在某个位置创建或复制文件,然后将其粘贴到另一个位置,然后将我的用户名和电子邮件添加到文档中.

如果那是正确的做法:

  • 我需要复制的文件在哪里(或者我需要创建的文件叫什么)
  • 我将文件放在哪里
  • 我是否需要在文件中添加以下两行?

    [ui]
    username = Your Name <your@email.com>
    

感谢您的帮助.

解决方案

该文件名为.hgrc,位于您的主目录中.如果仅将这些行添加到~/.hgrc,一切都应该没问题.

有关Mercurial配置文件的非常详细的概述,位于此处. /p>

另一种不太方便的方法是在命令行中传递-u your@email.com.

I've just installed Mercurial on my OSX Mountain Lion Max (10.8) and on my first commit I'm getting the error:

abort: no username supplied (see "hg help config")

I've seen a load of answers which suggest I need to create or copy a file form a certain location and paste it into another location and add my username and email to the document.

If that is the right thing to do:

  • Where is the file I need to copy (or what is the file called that I need to create)
  • Where do I put that file
  • Do I just need to add the following two lines to the file?

    [ui]
    username = Your Name <your@email.com>
    

Thanks for your help.

解决方案

That file is named .hgrc and it is located in your home directory. If you just append those lines to ~/.hgrc and everything should be fine.

An extremely detailed overview of the Mercurial configuration file is located here.

Another less convient way is to pass -u your@email.com on the command line.

这篇关于Mercurial“未提供用户名"在Mac上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 13:45