Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store password in TortoiseHg

People also ask

How do you set a username in Heartgold?

If you specify a -u option to the hg commit command on the command line, followed by a username, this is always given the highest precedence. If you have set the HGUSER environment variable, this is checked next. If you have set the EMAIL environment variable, this will be used next.

What is TortoiseHg used for?

TortoiseHg is a set of graphical applications and Windows Explorer shell extension that serve as a friendly front-end to the Mercurial distributed version control system (DVCS). You can start the Workbench from the Start Menu, or by right clicking on the Desktop and selecting Hg Workbench.

How do I update TortoiseHg?

1 Answer. Show activity on this post. Or in Workbench, right click on Tip and select Update. Or you can just right click, Update and select update to branchname / tip without worrying about the revision you are looking at.


Both existing answers suggest storing your username and password unencrypted in plain-text, which is a bit of a no-no.

You should use the Keyring extension instead, as it has been specifically designed for securely saving authentication passwords. It already comes bundled with TortoiseHg, so all you have to do is activate it by writing the following in your mercurial.ini file:

[extensions]
mercurial_keyring=

You will also have to associate your username with the push url by editing your repository-specific .hg\hgrc file like in the example below:

[paths]
default = https://<your_username>@bitbucket.org/tortoisehg/thg

For more details on associating your username with the url, see the Repository Configuration (SMTP) section of the Keyring extension page.


Three steps, watch screenshot. Note: This stores your password in plaintext.

enter image description here


Security warning

Although this answer is accepted as of 2017-09-15, it is not a recommended solution. You should never store your passwords in plain text. Use the mercurial_keyring extension instead. See another answer here.


You can change your push URL to https://username:[email protected]/repo.

This is explained in Google Code's and Mercurial's FAQs.

EDIT: Mercurial FAQ explains another way to do it:

With Mercurial 1.3 you can also add an auth section to your hgrc file:
[auth]
example.prefix = https://hg.example.net/
example.username = foo
example.password = bar

If you want to configure it via TortoiseHg, Repository Setting dialog is available. After opening the dialog, please switch to 'Sync' tab. You can add a path with HTTPS auth information.

http://tortoisehg.bitbucket.io/manual/2.9/settings.html#module-web.settings


Simply modify the hgrc file in the .hg directory of your local repository so it looks like this:

[paths]
default = https://name:[email protected]/hg/

where name is your Google Code login without the gmail/googlemail bit e.g. 'fredb' (not [email protected]), password is the Google-generated password, and yourproj is the name of your GC project. So something like:

default = https://fred:[email protected]/hg/