![]() ![]() the file has not changed since its last committed state) the “log” command shows us the history of changes committed to the repository. The “status -A” command shows us all files in the working directory and their status (the “C” means “clean”, I.e. If it’s not there, then simply create an empty file with that name and open it in your favorite text editor. Navigate to your user profile directory (powershell shortcut: “cd $env:userprofile”) and look for a file called “mercurial.ini”. There’s a few settings that we’ll want to configure at the user level, so we’ll start there. Mercurial stores its settings at three levels: computer wide, the current user, and the current repository. Next, we’ll want to change a few settings. This command initializes the repository, and if it works you’ll see a folder called “.hg” in your directory. To create a new repository, simply open a command prompt, navigate to the folder where you want the repository created, and type “hg init”. Remember, each and every user has their own complete copy of the repository kept locally, including all history. Once the installation finishes we can go on to creating our first repository.īefore we go on, it bears repeating that the concept of a “repository” is very different with a distributed version control system than with more tradition server-centric models. When running the installation package, I recommend leaving the default options selected. As we’ll see, viewing the differences between files is a huge part of using version control. I’d also recommend that you download and install WinMerge, which at least in my opinion is the best visual comparison tool available. I do this for two reasons: 1) it’s an easy way to grab everything you need in one shot, 2) there are still times when I find a GUI nice, such as looking at revision history. Yes, I know I just said I love the command line, and yet I’m advocating downloading a GUI tool. I find the best way to get this is to go and grab TortoiseHG, an excellent variation on the popular TortoiseSVN Subversion client. Note: I’m very much a command line guy, so I will tend to give examples using that as a method when possible.įirst we need to download the Mercurial tools. Now that we have some ideas for things to actually put in version control, how do we actually go about getting it setup? The steps are not difficult, so we’ll go through them here one at a time. In this article, I’m going to go a step further and actually walk you through setting up your first repository (locally for now, we’ll go into setting up a remote one later), making your first commit, and making (and viewing) changes to your newly tracked files. We also gave three examples of instances where source control can come in handy (though to be honest they were picked from a much longer list). Resolve conflicts as described in Resolve conflicts.In my previous article, we went over the reasons why DBAs should use version control, as well as the benefits of Mercurial as a specific choice. To have any local changes overwritten, select the Overwrite locally modified files (no backup) checkbox.Īs soon as a conflict takes place, the Conflicts dialog opens with a list of conflicting files. To switch to a changeset identified by a hash, choose Revision and type the desired revision number in the field. To switch to a changeset to which you have previously assigned a tag identifier, choose Tag and select the desired tag from the drop-down list. To switch to another line of development, choose Branch and select the desired branch from the list. In the Switch Working Directory dialog that opens, specify the target working directory: Select the branch or bookmark to which you want to switch and in the menu that opens, click Update.įrom the main menu, select Hg | Mercurial | Update to. In the Status bar, click the Mercurial Branch widget to open the Branches popup. Quickly switch to another branch or bookmark ![]() If your current working copy is not clean, you can either commit the changes or shelve them as described in Shelve and unshelve changes. Changesets can be identified by their hashes or by previously assigned tag identifiers.īy default, Mercurial requires that before update the current working directory should be clean. The Mercurial integration with JetBrains Rider provides the possibility to switch update the repository's working directory to the specified changeset or a specific line of development. Switch between Mercurial working directories
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |