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

ConfigurationMercurial

Configuration Problem Overview


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?

Configuration Solutions


Solution 1 - Configuration

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>

Solution 2 - Configuration

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>

Solution 3 - Configuration

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)

Solution 4 - Configuration

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

Solution 5 - Configuration

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

Solution 6 - Configuration

put file .hgrc in $HOME or home/user

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSnehalView Question on Stackoverflow
Solution 1 - ConfigurationcjgView Answer on Stackoverflow
Solution 2 - ConfigurationncowboyView Answer on Stackoverflow
Solution 3 - ConfigurationZombieSheepView Answer on Stackoverflow
Solution 4 - ConfigurationNikolai SaikoView Answer on Stackoverflow
Solution 5 - ConfigurationbrannerchineseView Answer on Stackoverflow
Solution 6 - Configurationuser330606View Answer on Stackoverflow