A shared Git repository gives collaborators access to a project's files and change history. On a Linux desktop, IntelliJ IDEA can clone the repository and open the checked-out files as a project.

A public repository's HTTPS clone URL works without a hosting account. IntelliJ IDEA suggests a folder based on the repository name, and specifying your own folder lets you keep the checkout beside the projects you already have.

Git starts the local checkout on the remote repository's default branch. The branch shown in the IDE tells you which line of development the open files came from.

Steps to clone a Git project in JetBrains IDE:

Have Git installed and know the HTTPS clone URL and default branch of a public repository you trust. The example uses GitHub's Hello-World repository, whose default branch is master. Start with IntelliJ IDEA visible in the GNOME app grid and no project open. Use the default window layout, which shows Project when the checkout opens.

  1. Open IntelliJ IDEA from the GNOME app grid.
  2. Click Clone Repository on IntelliJ IDEA Home.
  3. Enter your repository's HTTPS clone address in URL, replacing any existing text.

    The example uses https://github.com/octocat/Hello-World.git.

  4. Click the Clone into field.
  5. Enter the full path to a new folder in Clone into, replacing the suggested path.

    The example uses /home/reader/IdeaProjects/hello-world. Your path should use your own home directory and project name.

  6. Click Clone to download the repository into the chosen folder.

    Trusting a project lets IntelliJ IDEA run code from it, including startup tasks and build scripts. If a trust dialog appears, proceed only if you trust the source, recognize the folder named in the dialog, and the folder-wide trust checkbox is clear.

  7. Click Trust Project if IntelliJ IDEA asks whether to open the checkout.

    The next step starts when Analyzing project clears from the status bar. If the editor shows Air or Junie's Accept and Install offer, you can continue to Project without installing them.

  8. Double-click a checked-out file in Project, such as README under hello-world.
  9. Click the Git branch widget in the top toolbar of the open project.
  10. Confirm that the branch marked with the yellow tag under Local matches the repository's default branch.

    The example shows master beside origin/master while the checked-out README is open in the editor.

Share this guide