JetBrains Space Help

Mirror an External Repository

Create a synchronized copy of an existing remote repository from external Git hosting.

  1. Navigate to the project in which you want to create a repository.

  2. On the project sidebar, choose Repositories.

  3. On the repositories page, click New repository:

    clickNewRepository.pngg
  4. On the dialog window, choose Import a repository:

    createRepoForm-ExternalMirror.png
  5. Specify the following:

    • Remote repository URL

      Enter the URL of the target remote repository (hosted outside of Space).

    • Repository name in Space

      Give your Space mirror repository a distinctive name and optional description. The name may not necessarily match your remote source repository name.

    • Select Mirror changes from external repository.

    • Authentication

      Enter the credentials required to access the remote repository. Normally, you can provide the same credentials you use in your Git client to access your remote repository from your local machine. Depending on the remote repository access rules, you may need to provide either an SSH private key or your username/password. Choose Anonymous if no credentials are required.

      If connecting via SSH, you need to have an SSH key pair (private and public) generated and stored on your local machine in the .ssh\ subdirectory. Provide the private key to Space by uploading it to the corresponding field and enter the passphrase if your key is protected with one.

      The credentials will be stored in Space and used to synchronize the repository.

    • Synchronization settings

      Choose updating options for your mirror:

      • Sync periodically. Your mirror will be synced with the remote repository and updated approximately once an hour. Actual update frequency may vary as it depends on server load.

      • Sync on git fetch. The mirror will be synced with the remote repository every time someone runs the git fetch command.

      • Remote supports atomic pushes. The git push --atomic option is used when pushing multiple branches to a remote Git server, to ensure that either all the reference updates are accepted, or none of them are. Most remote Git hosting services support atomic pushes, but if your remote repository doesn't — clear this checkbox.

      To sync on update, set up push notifications from the remote repository to this web address. While a periodic sync will keep your mirror repository updated, a delay is unavoidable. To have your mirror updated instantly when a change is pushed to the source repository, you may want to set up push notifications (a webhook) on the source remote repository side. When setting up a webhook, provide it with the endpoint URL displayed in the field.

    • Tracked branches and tags (Git refspecs)

      using refspec mapping, specify the branches that should be mirrored and synced. Leave the field blank to sync all branches.

  6. When you are done, click Create.

    A synchronized copy of your external repository will be created and added to your project.

Last modified: 14 June 2023