Setting 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.
To clone a remote mercurial repository
- On the main menu, choose Clone Mercurial Repository dialog box opens. . The
- In the Mercurial Repository URL text box, type the URL of the remote repository which you want to clone.
- 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.
- In the Parent Directory text box, specify the directory where you want PyCharm to create a folder for your local Mercurial repository. Use the Browse button button, if necessary.
- In the Directory Name text box, specify the name of the new folder into which the repository will be cloned. Click Clone.
- Create a new project based on the cloned data by accepting the corresponding suggestion displayed by PyCharm.
To create a local mercurial repository
- Open the project you want to store in a repository.
- On the main menu, choose Create Mercurial Repository dialog box opens. . The
- 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.
PyCharm will create the
.hgdirectory 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 text box below. Type the path manually or click the Browse button and choose the relevant folder in the Select directory for hg init dialog box that opens.
- To have the repository created in the project root, choose the Create repository for the whole project option. PyCharm will create the
- Put the required files under Mercurial version control. The files appear in the Changes tool window under the Default node.
Last modified: 15 May 2015