IntelliJ IDEA 13.1 Web Help

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.
To clone a remote mercurial repository
  1. On the main menu, choose VCS | Checkout from Version Control | Mercurial. The Clone Mercurial Repository dialog box opens.
  2. In the Mercurial Repository URL text box, type the URL of the remote repository which you want to clone.
  3. Click the Test Repository button next to the Mercurial Repository URL text box to check that connection to the remote repository can be established successfully.
  4. In the Parent Directory text box, specify the directory where you want IntelliJ IDEA to create a folder for your local Mercurial repository. Use the Browse button browseButton.png button, if necessary.
  5. In the Directory Name text box, specify the name of the new folder into which the repository will be cloned. Click Clone.
  6. Create a new project based on the cloned data by accepting the corresponding suggestion displayed by IntelliJ IDEA.
To create a local mercurial repository
  1. Open the project you want to store in a repository.
  2. On the main menu, choose VCS | Import into Version Control | Create Mercurial Repository. The Create Mercurial Repository dialog box 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. IntelliJ IDEA will create the .hg directory in the project root folder.

      Note

      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 text box below. Type the path manually or click the Browse button browseButton.png and choose the relevant folder in the Select directory for hg init dialog box that opens.

    Warning

    1. Mercurial does not support external paths. So if you choose another directory, note that it must contain the tree where the project root resides.
    2. If you choose a directory which is already under Mercurial control, IntelliJ IDEA opens the Directory Is Under hg dialog box, where you can choose to create a repository in the specified location or to stay in the parent repository.
  4. Put the required files under Mercurial version control. The files appear in the Changes tool window under the Default node.

    Tip

    If you specify Mercurial as the version control system for a directory in the Version Control dialog box, IntelliJ IDEA will suggest to put each new file in this directory under Mercurial control.

See Also

Concepts:

Procedures:

Reference:

Web Resources: