

Comparatively, Git has covered more than 80% market share.īoth version control systems, i.e., Mercurial and Git are distributed version control systems (DVCS). But it only has approx 2 % of the VCS market share.
#MERCURIAL TORTOISEHG TUTORIAL SOFTWARE#
Some software development giants like Facebook, Mozilla, and World Wide Web Consortium are using it. Mercurial still has a handful tool of large development organizations. Since the last decade, the Git has become the standard for most development projects. Today, Git has more than 31 million users and is owned by Microsoft. It can handle projects of any size and offers an easy and intuitive interface. Mercurial is a distributed source control management tool. Both tools use a directed acyclic graph to store history. Their strengths and weaknesses make them ideal for different use cases. We can just discard the changes (revert) and continue from the last safe point.Mercurial and Git both are two quite similar and most popular distributed version control systems. Doing this properly we will never find ourselves struggling to come back to a previous state where everything was working. And we should take as many snapshots as needed. So now a commit is just a snapshot of the code. The biggest advantage of DVCS over centralized systems is that our commits don’t affect others.
#MERCURIAL TORTOISEHG TUTORIAL CODE#
People coming from CVS or Mercurial are used to commit only when the code compiles and tests pass, because a commit affects the other teammates. On refactor, sometimes I add the name of refactor used (i.e “refactor: extract method”).

In red, I copy the name of the test as part of the commit comment. I prefix the comment with “red:”, “green” or “refactor:”. To be efficient with that, I don’t worry much about the commit comment. I usually commit on red (test failing), on green (test passing) and eventually on refactor. It serves as documentation for others and saves me time when I want to jump back to a previous state. I use the VCS to keep track of my TDD flow. The filter bar also admits filter commands. For example to search for commits made by user with name John write “user(‘john’)” on the filter bar. The second most common operation we do with TortoiseHG is searching for commits. The “filter bar” must be enabled for that. Then we can write any word that we want to search for in the commits comments. That window shows only commits where the selected file was changed. Another useful item in the menu is the “File History” of each file, which opens up in a new window. The same menu also gives the choice to discard changes made on the selected file (the “Revert” menu item). (unversioned file) pops over the menu with the option to add. Using the right mouse button over the pink file This is one way we can add existing source files into the repository or files that we create later. If we need to commit the change into a new branch, we can do that clicking on the label “Branch: default” right on top of the comment area.įrom the “commit view” it’s also possible to track new files. Once the commit comment is introduced we just need to click on the “Commit” button on the right hand side. See the “Copy message” dropdown right on top of the comment area. Text from previous comments can be retrieved in case we want to reuse the same comment. If there has been changes while this view was displayed, we need to refresh ( blue circle button in the middle of the screen) in order toįinally, the commit needs a comment that goes into the comment area. From this view we can see changed files and their contents. To display this view click on the green tick button on the top. The “commit view”, is where pending changes (uncommitted) can be seen. That can be done through the “New Repository” in the “File” menu. Select “Commit” on the left hand side and introduce some username on the right. Open the settings window through the “File” menu. So let’s open up the workbench now. If it’s the first time we open the workbench we must tell TortoiseHG what is our username. We are going to use the TortoiseHG Workbench.

It’s got the same GUI in Linux, MacOS and Windows. And TortoiseHG is an excellent client app. A version control system should be easy to use, at least when you just need to perform basic tasks.
