Pushing with mercurial: abort: no username supplied (see "hg help config")
Asked Answered
O

2

6

I'm not sure why but since today I have the problem with pushing my source to repo. I got abort: no username supplied (see "hg help config") The thing is that I have [ui] section in hgrc:

[ui]
username = My username
verbose = true

Where's the problem then?

Oniskey answered 11/5, 2012 at 16:49 Comment(2)
where is this hgrc file located ?Clemens
You're better off putting that in your home directory in a .hgrc or mercurial.ini file since your username is usually the same.Tryparsamide
T
10

Try doing:

hg --debug showconfig

that shows you all the configuration settings Mercurial is finding and where it's finding them. Since it looks like you're on windows one possibility is BOMs (byte order markers) at the front of your hgrc file. Nodepad likes to incorrectly put them in there.

In a pinch you can always do hg --config ui.username=Whatever_you_want commit, but that's a terrible long term solutions.

Lastly, one expects that error on commit, but you said you're getting it on push. I can't imagine how that could happen.

Tryparsamide answered 12/5, 2012 at 0:58 Comment(2)
@AlexanderOrlov are you trying to do it as a command that sets your user name? That's not what it does. It let's you override the username on the commit command.Tryparsamide
Just want to add that [ui] is case-sensitive, since that was my issueSuperintendent
S
-3

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

[ui]
username = Your Name <your@mail>
Schuman answered 14/10, 2013 at 13:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.