abort: no username supplied (see “hg help config”)

前端 未结 6 2111
逝去的感伤
逝去的感伤 2020-12-23 08:31

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 ge

相关标签:
6条回答
  • 2020-12-23 09:06

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

    0 讨论(0)
  • 2020-12-23 09:13

    put file .hgrc in $HOME or home/user

    0 讨论(0)
  • 2020-12-23 09:14

    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 <forename.surnamce@email.com>
    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)

    0 讨论(0)
  • 2020-12-23 09:14

    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 <jdoe@example.com>
    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

    0 讨论(0)
  • 2020-12-23 09:16

    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>
    
    0 讨论(0)
  • 2020-12-23 09:18

    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>
    
    0 讨论(0)
提交回复
热议问题