Setting username in Mercurial .hgrc file

18,220

For future reference: use

$ hg showconfig ui --debug

to see the settings from the [ui] section and to see the files Mercural reads for configuration settings. That should help you along if you ever have to debug such a case again.

Share:
18,220

Related videos on Youtube

kamek
Author by

kamek

Updated on June 04, 2022

Comments

  • kamek
    kamek about 2 years

    I have been browsing SO and Google for a solution to my basic problem, and so far I have had no luck.

    I am brand new to Mercurial and have just installed it on my Mac. I am using it for personal version control and will not be communicating with a central server (yet).

    When I try to commit files, I get abort: no username supplied (see "hg help config"). The common solution to this problem is putting the following in ~/.hgrc

    [ui]
    username = Firstname Lastname <[email protected]>
    

    which I have done, but the error remains. It just won't read the file. Any suggestions?

    • Ishbir
      Ishbir over 12 years
      Could be some typo on your part. Please verify that cat ~/.hgrc (copy-paste that to a shell) produces the necessary config data. Update your question with the (appropriately anonimized) output.
    • Paul S
      Paul S over 12 years
      @Adam Mercurial.ini is Windows only.
    • Adam Houldsworth
      Adam Houldsworth over 12 years
      @PaulS Yeah I suspected as much :-(
    • daniel kullmann
      daniel kullmann over 12 years
      What is the output of hg.exe showconfig | grep ui?
    • César
      César over 12 years
      Does hg commit -u username -m "msg" works?
    • kamek
      kamek over 12 years
      Sorry for the delay -- I currently have not internet access on the computer that I have been setting up Mercurial. Well the problem is "fixed", in that restarting my computer (for the first time in a month or so) seems to have fixed the problem (however, the reliability of this is unknown).
    • Martin Geisler
      Martin Geisler over 12 years
      @danielkullmann: just a small note: instead of using grep (which is normally not there on Windows), then just do hg showconfig ui to get the settings from the [ui] section.