Reputation: 21
I have installed Mercurial and BitBucket on my Mac. I created a repository and was able to add files. But I get no username supplied when trying to commit. The solution involved editing the .hgrc file. But this does not exist on my machine. Do I need to create it?
Upvotes: 2
Views: 2626
Reputation: 2187
Yes, you need to create ~/.hgrc
. For example, a minimal version that only includes the necessary username:
[ui]
username = John Doe <[email protected]>
The value of the username property is free-form text, but the convention is as shown (Full Name <emailaddress>
).
As an alternative, you could create/edit .hg/hgrc
inside your repository. In that case, the username
you set would apply only to that repository. ~/.hgrc
is for per-user configuration, while .hg/hgrc
inside a repository is for configuration that should apply only to that repository. If a given property exists in both, the value in the repository-specific hgrc
overrides the value in the global ~/.hgrc
. The syntax is the same regardless. /etc/mercurial/hgrc
is for the system-global configuration, but usually not a good place to define the username
.
Use man hgrc
for more information.
Upvotes: 8