Vrajesh Bhavsar
Vrajesh Bhavsar

Reputation: 31

Why do I not have a .hgrc file?

I'm trying to insert the mercurial_keyring file with my username and password in the .hgrc file but it doesn't exist in my user directory on windows. I have tortoise hg installed and even checked if it was installed properly on the command prompt yet I still don't have the .hgrc folder.

Can anyone tell me what might be the reason to it?

Thanks

Upvotes: 2

Views: 4142

Answers (3)

nwsmith
nwsmith

Reputation: 516

Run the command 'hg config --debug' and it will give full details of the configuration steps. Somewhere near the start you will see something like this:

read config from: C:\Program Files\TortoiseHg\mercurial.ini
read config from: C:\Users\<UserName>\mercurial.ini
read config from: C:\Users\<UserName>\.hgrc

So those are the files it's looking for...

Upvotes: 0

Lazy Badger
Lazy Badger

Reputation: 97260

Because it's %USERPROFILE%\mercurial.ini

Mercurial reads configuration data from several files, if they exist. These files do not exist by default and you will have to create the appropriate configuration files yourself:

Local configuration is put into the per-repository /.hg/hgrc file.

Global configuration like the username setting is typically put into:

%USERPROFILE%\mercurial.ini (on Windows)

Upvotes: 5

Nanhydrin
Nanhydrin

Reputation: 4472

The .hgrc files are not created automatically when you install Mercurial or TortoiseHg.
You will need to manually create it at the location you need whether that is within the repository's .hg folder or your own C:\Users\username\ folder.
You will probably need to use the command line to create the file as it's not usually possible to create filenames that start with . in Windows Explorer.

https://www.selenic.com/mercurial/hgrc.5.html

Upvotes: 0

Related Questions