Stop an import for a repository.
octokit.migrations.cancelImport({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the List user migrations and Get a user migration status endpoints, will continue to be available even after an archive is deleted.
octokit.migrations.deleteArchiveForAuthenticatedUser({migration_id,});
name | required | description |
---|---|---|
migration_id | yes | migration_id parameter |
See also: GitHub Developer Guide documentation.
Deletes a previous migration archive. Migration archives are automatically deleted after seven days.
octokit.migrations.deleteArchiveForOrg({org,migration_id,});
name | required | description |
---|---|---|
org | yes | |
migration_id | yes | migration_id parameter |
See also: GitHub Developer Guide documentation.
Fetches the URL to a migration archive.
octokit.migrations.downloadArchiveForOrg({org,migration_id,});
name | required | description |
---|---|---|
org | yes | |
migration_id | yes | migration_id parameter |
See also: GitHub Developer Guide documentation.
Fetches the URL to download the migration archive as a tar.gz
file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:
The archive will also contain an attachments
directory that includes all attachment files uploaded to GitHub.com and a repositories
directory that contains the repository's Git data.
octokit.migrations.getArchiveForAuthenticatedUser({migration_id,});
name | required | description |
---|---|---|
migration_id | yes | migration_id parameter |
See also: GitHub Developer Guide documentation.
Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username hubot
into something like hubot <hubot@12341234-abab-fefe-8787-fedcba987654>
.
This endpoint and the Map a commit author endpoint allow you to provide correct Git author information.
octokit.migrations.getCommitAuthors({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
since | no | A user ID. Only return users with an ID greater than this ID. |
See also: GitHub Developer Guide documentation.
View the progress of an import.
Import status
This section includes details about the possible values of the status
field of the Import Progress response.
An import that does not have errors will progress through these steps:
detecting
- the "detection" step of the import is in progress because the request did not include a vcs
parameter. The import is identifying the type of source control present at the URL.importing
- the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include commit_count
(the total number of raw commits that will be imported) and percent
(0 - 100, the current progress through the import).mapping
- the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.pushing
- the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include push_percent
, which is the percent value reported by git push
when it is "Writing objects".complete
- the import is complete, and the repository is ready on GitHub.If there are problems, you will see one of these in the status
field:
auth_failed
- the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the Update an import section.error
- the import encountered an error. The import progress response will include the failed_step
and an error message. Contact GitHub Support or GitHub Premium Support for more information.detection_needs_auth
- the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the Update an import section.detection_found_nothing
- the importer didn't recognize any source control at the URL. To resolve, Cancel the import and retry with the correct URL.detection_found_multiple
- the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a project_choices
field with the possible project choices as values. To update project choice, please see the Update an import section.The project_choices field
When multiple projects are found at the provided URL, the response hash will include a project_choices
field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.
Git LFS related fields
This section includes details about Git LFS related fields that may be present in the Import Progress response.
use_lfs
- describes whether the import has been opted in or out of using Git LFS. The value can be opt_in
, opt_out
, or undecided
if no action has been taken.has_large_files
- the boolean value describing whether files larger than 100MB were found during the importing
step.large_files_size
- the total size in gigabytes of files larger than 100MB found in the originating repository.large_files_count
- the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.octokit.migrations.getImportStatus({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
List files larger than 100MB found during the import
octokit.migrations.getLargeFiles({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Fetches a single user migration. The response includes the state
of the migration, which can be one of the following values:
pending
- the migration hasn't started yet.exporting
- the migration is in progress.exported
- the migration finished successfully.failed
- the migration failed.Once the migration has been exported
you can download the migration archive.
octokit.migrations.getStatusForAuthenticatedUser({migration_id,});
name | required | description |
---|---|---|
migration_id | yes | migration_id parameter |
exclude | no |
See also: GitHub Developer Guide documentation.
Fetches the status of a migration.
The state
of a migration can be one of the following values:
pending
, which means the migration hasn't started yet.exporting
, which means the migration is in progress.exported
, which means the migration finished successfully.failed
, which means the migration failed.octokit.migrations.getStatusForOrg({org,migration_id,});
name | required | description |
---|---|---|
org | yes | |
migration_id | yes | migration_id parameter |
See also: GitHub Developer Guide documentation.
Lists all migrations a user has started.
octokit.migrations.listForAuthenticatedUser();
name | required | description |
---|---|---|
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists the most recent migrations.
octokit.migrations.listForOrg({org,});
name | required | description |
---|---|---|
org | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
List all the repositories for this organization migration.
octokit.migrations.listReposForOrg({org,migration_id,});
name | required | description |
---|---|---|
org | yes | |
migration_id | yes | migration_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists all the repositories for this user migration.
octokit.migrations.listReposForUser({migration_id,});
name | required | description |
---|---|---|
migration_id | yes | migration_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository.
octokit.migrations.mapCommitAuthor({owner,repo,author_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
author_id | yes | |
no | The new Git author email. | |
name | no | The new Git author name. |
remote_id | no |
See also: GitHub Developer Guide documentation.
You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by Git LFS. You can learn more about our LFS feature and working with large files on our help site.
octokit.migrations.setLfsPreference({owner,repo,use_lfs,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
use_lfs | yes | Can be one of |
See also: GitHub Developer Guide documentation.
Initiates the generation of a user migration archive.
octokit.migrations.startForAuthenticatedUser({repositories,});
name | required | description |
---|---|---|
lock_repositories | no | Lock the repositories being migrated at the start of the migration |
exclude_attachments | no | Do not include attachments in the migration |
exclude | no | Exclude attributes from the API response to improve performance |
repositories | yes |
See also: GitHub Developer Guide documentation.
Initiates the generation of a migration archive.
octokit.migrations.startForOrg({org,repositories,});
name | required | description |
---|---|---|
org | yes | |
repositories | yes | A list of arrays indicating which repositories should be migrated. |
lock_repositories | no | Indicates whether repositories should be locked (to prevent manipulation) while migrating data. |
exclude_attachments | no | Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). |
exclude | no |
See also: GitHub Developer Guide documentation.
Start a source import to a GitHub repository using GitHub Importer.
octokit.migrations.startImport({owner,repo,vcs_url,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
vcs_url | yes | The URL of the originating repository. |
vcs | no | The originating VCS type. Can be one of |
vcs_username | no | If authentication is required, the username to provide to |
vcs_password | no | If authentication is required, the password to provide to |
tfvc_project | no | For a tfvc import, the name of the project that is being imported. |
See also: GitHub Developer Guide documentation.
Unlocks a repository. You can lock repositories when you start a user migration. Once the migration is complete you can unlock each repository to begin using it again or delete the repository if you no longer need the source data. Returns a status of 404 Not Found
if the repository is not locked.
octokit.migrations.unlockRepoForAuthenticatedUser({migration_id,repo_name,});
name | required | description |
---|---|---|
migration_id | yes | migration_id parameter |
repo_name | yes | repo_name parameter |
See also: GitHub Developer Guide documentation.
Unlocks a repository that was locked for migration. You should unlock each migrated repository and delete them when the migration is complete and you no longer need the source data.
octokit.migrations.unlockRepoForOrg({org,migration_id,repo_name,});
name | required | description |
---|---|---|
org | yes | |
migration_id | yes | migration_id parameter |
repo_name | yes | repo_name parameter |
See also: GitHub Developer Guide documentation.
An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
octokit.migrations.updateImport({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
vcs_username | no | The username to provide to the originating repository. |
vcs_password | no | The password to provide to the originating repository. |
vcs | no | |
tfvc_project | no |
See also: GitHub Developer Guide documentation.