IntelliJ IDEA 2017.1 Help

Setting Up a Local Git Repository

Although Git provides high flexibility in arranging data and your work with repositories, the following scenarios are most commonly used for setting up a local Git 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 Git repository

  1. On the main menu, choose VCS | Checkout from Version Control | Git. The Clone Repository dialog box opens.
  2. In the Git Repository URL text box, type the URL of the remote repository which you want to clone.
  3. Click the Test button next to the Git 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 Git repository. Use /help/img/idea/2017.1/browseButton.png, 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.

Git root mapping will be automatically set to the project root directory.

To create a local Git repository

  1. Open the project you want to store in a repository.
  2. On the main menu, choose VCS | Import into Version Control | Create Git Repository.
  3. In the dialog that opens, specify the directory where you want to create a new Git repository.
  4. Put the required files under Git version control. The files appear in the Local Changes tab of the Version Control tool window, under the Default changelist.

See Also

Last modified: 18 July 2017