中止:未提供用户名(请参阅“hg help config”)

发布于 2024-08-25 09:23:23 字数 174 浏览 4 评论 0原文

我已经添加了存储库,并且在提交时出现错误,因为

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

我在本地也没有获取 Mercurial.ini 文件。有谁知道如何解决 Fedora 上的此错误?

I have added repository and at the time of commit I get error as

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

I am not getting Mercurial.ini file on my local as well. Does anyone know how I can resolve this error on Fedora?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

友谊不毕业 2024-09-01 09:23:23

将 hgrc 放在存储库中的 .hg 目录中,或者将 .hgrc (适用于 Windows 的 hgrc)文件放在您的主目录中(然后它会覆盖您的所有项目)
在文件中你应该写

[ui]
username = Your Name <your@mail>

Either put a hgrc in the .hg directory in your repo or put a .hgrc (hgrc for Windows) file in your home dir (then it covers all your projects)
In the file you should write

[ui]
username = Your Name <your@mail>
幽蝶幻影 2024-09-01 09:23:23

在 Windows 上,读取这些配置文件:

- "<repo>\.hg\hgrc"
- "%USERPROFILE%\.hgrc"
- "%USERPROFILE%\Mercurial.ini"
- "%HOME%\.hgrc"
- "%HOME%\Mercurial.ini"
- "C:\Mercurial\Mercurial.ini"
- "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial"
- "<install-dir>\Mercurial.ini"

在 Unix 上,读取这些文件:

- "<repo>/.hg/hgrc"
- "$HOME/.hgrc"
- "/etc/mercurial/hgrc"
- "/etc/mercurial/hgrc.d/*.rc"
- "<install-root>/etc/mercurial/hgrc"
- "<install-root>/etc/mercurial/hgrc.d/*.rc"

在上面的这些文件之一中包含以下内容:

[ui]
username = Your Name <your@mail>

On Windows, these configuration files are read:

- "<repo>\.hg\hgrc"
- "%USERPROFILE%\.hgrc"
- "%USERPROFILE%\Mercurial.ini"
- "%HOME%\.hgrc"
- "%HOME%\Mercurial.ini"
- "C:\Mercurial\Mercurial.ini"
- "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial"
- "<install-dir>\Mercurial.ini"

On Unix, these files are read:

- "<repo>/.hg/hgrc"
- "$HOME/.hgrc"
- "/etc/mercurial/hgrc"
- "/etc/mercurial/hgrc.d/*.rc"
- "<install-root>/etc/mercurial/hgrc"
- "<install-root>/etc/mercurial/hgrc.d/*.rc"

Include the following in one of these files above:

[ui]
username = Your Name <your@mail>
宛菡 2024-09-01 09:23:23

简单的答案 - 在您的 .hg 文件夹中,创建一个名为 .hgrc 的文件
在那里,添加以下内容(检查 hg help config 以获取确切的语法)

[ui]
username = forename surname <[email protected]>
verbose = True

并保存。现在应该可以工作了。请注意,verbose = True 不是必需的,但我将其包含在内,因为它已在帮助内容中列出

(这是凭记忆,但 hg help config 会告诉您正确的文件名和语法)

Simple answer - in your .hg folder, create a file named .hgrc
in there, add the following content (check hg help config for the exact syntax)

[ui]
username = forename surname <[email protected]>
verbose = True

and save it. Should work now. Note that verbose = True is not required, but I included it since it is listed in the help content

(This is from memory, but hg help config will tell you the correct filename and syntax)

忘羡 2024-09-01 09:23:23

运行hg config --edit(在hg 3.1中在linux debianwindows上进行测试)
它将创建(如果不存在)并打开一个包含文本的文件:

# example config (see "hg help config" for more info)

[ui]
# name and email, e.g.
# username = Jane Doe <[email protected]>
username = 

[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
# pager =
# progress =
# color =  

填写“用户名”字段并保存文件

run hg config --edit ( tested it in hg 3.1 both on linux debian and windows)
it will create (if not exists) and open a file with text:

# example config (see "hg help config" for more info)

[ui]
# name and email, e.g.
# username = Jane Doe <[email protected]>
username = 

[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
# pager =
# progress =
# color =  

fill "username" field and save the file

抱猫软卧 2024-09-01 09:23:23

确保当前用户拥有 hgrc 文件或具有正确的权限。

Make sure that the current user owns the hgrc file or otherwise has correct permissions for it.

起风了 2024-09-01 09:23:23

将文件 .hgrc 放在 $HOME 或 home/user 中

put file .hgrc in $HOME or home/user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文