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

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?


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>

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>

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)


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


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