When I commit something in Mercurial like this:
hg commit -m "username question"
I see this output:
No username found, using 'WindowsVistaAdmin@ChunkyMonkey' instead
ChunkyMonkey
is my Windows machine name and obviously WindowsVistaAdmin
is the user that I am signed in as on this machine.
How can I set the username to something more respectable, or, at least, more concise?
You should think of the HGUSER environment variable and the -u option to the hg commit command as ways to override Mercurial's default selection of username. For normal use, the simplest and most robust way to set a username for yourself is by creating a . hgrc file; see below for details.
In your ~/.hgrc
(*nix) or mercurial.ini
(Windows) file:
[ui] username = First Last <[email protected]>
(mercurial.ini
is in C:\Documents and Settings\[username]\
for XP and lower, C:\Users\[username]\
for Vista and higher. You can also run hgtk userconfig
if you have TortoiseHg installed and do it that way.)
you can specify your username on the command line directly if you want to using --config. eg
hg --config ui.username=frymaster -m "comment here" commit
in fact, you can override anything in your .hgrc with this command. just look at your .hgrc and note the format:
[section] key=val
that translates directly to
hg --config section.key=val
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With