Mirror a GitHub Repository
Create a synchronized copy of an external repository hosted on GitHub. For GitHub repositories, Space supports pull requests/merge requests synchronization.
Navigate to the project in which you want to create a repository.
On the project sidebar, choose Repositories.
On the repositories page, click New repository:
On the dialog window, choose GitHub Mirror:
Specify the following:
GitHub repository URL
Provide the URL of your source repository hosted on GitHub in the following format:
https://github.com/owner-name/repository-name
.Repository name
Give your Space mirror repository a distinctive name and optional description. The name may not necessarily match your remote GitHub repository name.
Personal access token
GitHub requires you to use a personal access token to authenticate and access your repository.
You can use your existing GitHub token or create a new one — just click the Get a new token button. Then paste your token into the specified field.
The credentials will be stored in Space and used to synchronize the repositories.
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.
Both options can be selected.
To ensure instant and accurate synchronization of pull requests, we strongly suggest you set up a webhook on the GitHub side. The webhook should be targeted to
https://your-space-organization.jetbrains.space/~github-push-notification
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.
When you are done, click Create.
A synchronized copy of your external GitHub repository will be created and added to your project.