In addition, you can even see the versions of your files in graphical form. That is, how your file is being modified. I often used it to keep track my PCB layout as most of the time, once too much editing is done, the PCB layout tools will stop you from returning to the previous steps. Thus, this tool can be used not only with codes, but also with files. The method of setting up a repository and method of using it will be further discussed below:
Using Tortoise Hg

Souce Code Management with Tortoise Hg

Figure 1-1: Files to be added

Create a folder with the file or files to commit. Right click anywhere in the folder -> Tortoise Hg -> Create Repository Here. By doing so, Tortoise Hg init will be prompted as shown in Figure 1-2.

Souce Code Management with Tortoise Hg

Figure 1 2: Setting up a repository in the folder itself

If you need to run the commit directly, select “Run Commit after init”. If not, just click on create. In Figure 1-3, you can see that .hg and .hgignore has been created.

Tortoise Hg

Figure 1 3: .hg folder and .hgignore is created

Tortoise Hg

Figure 1 4: Adding comment and select files to commit

If you have selected “Run commit after init”, then, this window will be prompt. If not, click on the file -> Right hand click -> Hg Commit. Then, this window will be prompt. Select the files to commit and press commit.

Tortoise Hg software

Figure 1 5: Files that are committed to the repository

Once the files or folder has been committed, a green tick is created on the files or folder icon.

Souce Code Management with Tortoise Hg

Figure 1 6: Test1.doc has been modified

Any further modifications on the file will give the indication as shown in Figure 1-6.

Hg Repository Explorer

Figure 1 7: update to the previous version of the file

If you have modified your initial files too much and you intend to return to the last committed template, you can do so, by right click on the file -> Hg Repository Explorer -> click on the previous file, which you want to return to. Then, the window in Figure 1-7, will be prompt. After that, click update.

Hg Repository Explorer Figure 1-8: Shows the time the file has been modified and new v1.00 is created from the initial document file.

After updating, you can edit your current documents and commit them to the repository. Once it is done, open up the Hg Repository Explorer, again by right click on the file -> Hg Repository Explorer. You should be able to see similar layout as in Figure 1-8.


This software is very useful to manage your source codes, as well as your files without having too many versions on the screen. Additionally, it allows the user to return to the previous files, which is limited by the undo button itself in most of the software.

Note: Remember to commit the files each time you are edit your files. Without doing so, you will not be able to return to your previous documents.


Engineering Student

Leave a Reply

Your email address will not be published. Required fields are marked *