Skip to content

Update Git LFS preference

Deprecated
PATCH
/repos/{owner}/{repo}/import/lfs

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.

[!WARNING] Endpoint closing down notice: Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the changelog.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Media type application/json
object
use_lfs
required

Whether to store large files during the import. opt_in means large files will be stored using Git LFS. opt_out means large files will be removed during the import.

string
Allowed values: opt_in opt_out
Examples
Example default
{
"use_lfs": "opt_in"
}

Response

Media type application/json
Import

A repository import from an external source.

object
vcs
required
string
nullable
use_lfs
boolean
vcs_url
required

The URL of the originating repository.

string
svc_root
string
tfvc_project
string
status
required
string
Allowed values: auth error none detecting choose auth_failed importing mapping waiting_to_push pushing complete setup unknown detection_found_multiple detection_found_nothing detection_needs_auth
status_text
string
nullable
failed_step
string
nullable
error_message
string
nullable
import_percent
integer
nullable
commit_count
integer
nullable
push_percent
integer
nullable
has_large_files
boolean
large_files_size
integer
large_files_count
integer
project_choices
Array<object>
object
vcs
string
tfvc_project
string
human_name
string
message
string
authors_count
integer
nullable
url
required
string format: uri
html_url
required
string format: uri
authors_url
required
string format: uri
repository_url
required
string format: uri
svn_root
string
Examples
Example default
{
"vcs": "subversion",
"use_lfs": true,
"vcs_url": "http://svn.example.com/svn/myproject",
"status": "complete",
"status_text": "Done",
"has_large_files": true,
"large_files_size": 132331036,
"large_files_count": 1,
"authors_count": 4,
"url": "https://api.github.com/repos/octocat/socm/import",
"html_url": "https://import.github.com/octocat/socm/import",
"authors_url": "https://api.github.com/repos/octocat/socm/import/authors",
"repository_url": "https://api.github.com/repos/octocat/socm"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}

Unavailable due to service under maintenance.

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}