PhpStorm 2021.1 Help

Set up a local Mercurial repository

Although Mercurial provides high flexibility in arranging data and your work with repositories, the following scenarios are most commonly used for setting up a local Mercurial repository:

  • Clone an existing remote repository and create a new project with the downloaded data.

  • Create a local repository which you can push to a remote location later, if necessary.

Clone a remote Mercurial repository

  1. From the main menu, choose VCS | Get from Version Control. The Clone Mercurial Repository dialog opens.

  2. In the Get from Version Control dialog, select Mercurial from the Version control list and specify the URL of the remote repository you want to clone.

  3. Click Clone. If you want to create a PhpStorm project based on the sources you have cloned, click Yes in the confirmation dialog.

To create a local Mercurial repository

  1. Open the project you want to store in a repository.

  2. From the main menu, choose VCS | Import into Version Control | Create Mercurial Repository. The Create Mercurial Repository dialog opens.

  3. Specify the location of the new repository.
    • To have the repository created in the project root, choose the Create repository for the whole project option. PhpStorm will create the .hg directory in the project root folder.

      This option is selected by default.

    • To have a new repository created in another location, choose the Select where to create repository option and specify the path to the repository location in the field below. Type the path manually or click Browse the Browse button and choose the relevant folder in the Select directory for hg init dialog that opens.
  4. Put the required files under Mercurial version control. The files appear in the Local Changes view under the Default node.

    Note that if you specify Mercurial as the version control system for a directory in the Version Control dialog, PhpStorm will suggest to put each new file in this directory under Mercurial control.

Last modified: 12 May 2021