Skip to content

Fire Ali Sebay Fire Extinguishing #44554

@AliYehia360

Description

@AliYehia360

Code of Conduct

What article on docs.github.com is affected?

About GitHub Importer

If your source code is stored on another Git-based hosting service, you can move the code to GitHub.com using GitHub Importer.

About GitHub Importer

GitHub Importer is a tool that quickly imports Git repositories from other hosting services to GitHub.com.

To get started with GitHub Importer, see Importing a repository with GitHub Importer.

Capabilities and limitations of GitHub Importer

  • GitHub Importer imports the source code and commit history of a repository. It does not import other associated data from the hosting service, such as issues and pull requests.
  • GitHub Importer is only available on GitHub.com.
  • During an import, you can authenticate with your remote repository. The repository must be accessible from the public internet. If the repository is hosted on a private network, GitHub Importer won't be able to access it.
  • GitHub Importer does not support repositories that use version control systems other than Git, such as Mercurial, Subversion, or Team Foundation Version Control (TFVC). For more information about alternatives to GitHub Importer, see About source code imports using the command line.
  • Repositories and individual files on GitHub are subject to size limits. For more information, see About large files on GitHub.
  • GitHub Importer does not move Git Large File Storage (LFS) objects from the source repository to the target repository. If you use Git LFS, you will need to either convert the Git LFS objects to regular files tracked by Git before running the migration, or move the Git LFS objects to the new repository separately after running the migration.

Further reading

If your source code is tracked in a Git repository, you can import the repository using Git on the command line.

Before you start, make sure you know:

  • Your GitHub username
  • The clone URL for the external repository, such as https://external-host.com/user/repo.git or git://external-host.com/user/repo.git (perhaps with a user@ in front of the external-host.com domain name)

Note

For purposes of demonstration, we'll use:

  • An external account named extuser
  • An external Git host named https://external-host.com
  • A GitHub personal account named ghuser
  • A repository on GitHub.com named repo.git
  1. Create a new repository on GitHub. You'll import your external Git repository to this new repository.

  2. On the command line, make a "bare" clone of the external repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.

    $ git clone --bare https://external-host.com/EXTUSER/REPO.git
    # Makes a bare clone of the external repository in a local directory
  3. Push the locally cloned repository to GitHub using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.

    $ cd REPO.git
    $ git push --mirror https://github.com/USER/REPO.git
    # Pushes the mirror to the new repository on GitHub.com
  4. Remove the temporary local repository.

    cd ..
    rm -rf REPO.git

If the repository you are importing contains large files, you may run into a warning or error. For more information on large files and how to manage them, see About large files on GitHub.

Further reading

What changes are you suggesting?

Importing an external Git repository using the command line

If your source code is tracked in a Git repository, you can import the repository using Git on the command line.

Before you start, make sure you know:

  • Your GitHub username
  • The clone URL for the external repository, such as https://external-host.com/user/repo.git or git://external-host.com/user/repo.git (perhaps with a user@ in front of the external-host.com domain name)

Note

For purposes of demonstration, we'll use:

  • An external account named extuser
  • An external Git host named https://external-host.com
  • A GitHub personal account named ghuser
  • A repository on GitHub.com named repo.git
  1. Create a new repository on GitHub. You'll import your external Git repository to this new repository.

  2. On the command line, make a "bare" clone of the external repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.

    $ git clone --bare https://external-host.com/EXTUSER/REPO.git
    # Makes a bare clone of the external repository in a local directory
  3. Push the locally cloned repository to GitHub using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.

    $ cd REPO.git
    $ git push --mirror https://github.com/USER/REPO.git
    # Pushes the mirror to the new repository on GitHub.com
  4. Remove the temporary local repository.

    cd ..
    rm -rf REPO.git

If the repository you are importing contains large files, you may run into a warning or error. For more information on large files and how to manage them, see About large files on GitHub.

Further reading

If your source code is stored on another Git-based hosting service, you can move the code to GitHub.com using GitHub Importer.

About GitHub Importer

GitHub Importer is a tool that quickly imports Git repositories from other hosting services to GitHub.com.

To get started with GitHub Importer, see Importing a repository with GitHub Importer.

Capabilities and limitations of GitHub Importer

  • GitHub Importer imports the source code and commit history of a repository. It does not import other associated data from the hosting service, such as issues and pull requests.
  • GitHub Importer is only available on GitHub.com.
  • During an import, you can authenticate with your remote repository. The repository must be accessible from the public internet. If the repository is hosted on a private network, GitHub Importer won't be able to access it.
  • GitHub Importer does not support repositories that use version control systems other than Git, such as Mercurial, Subversion, or Team Foundation Version Control (TFVC). For more information about alternatives to GitHub Importer, see About source code imports using the command line.
  • Repositories and individual files on GitHub are subject to size limits. For more information, see About large files on GitHub.
  • GitHub Importer does not move Git Large File Storage (LFS) objects from the source repository to the target repository. If you use Git LFS, you will need to either convert the Git LFS objects to regular files tracked by Git before running the migration, or move the Git LFS objects to the new repository separately after running the migration.

Further reading

If your source code is stored on another Git-based hosting service, you can move the code to GitHub.com using GitHub Importer.

About GitHub Importer

GitHub Importer is a tool that quickly imports Git repositories from other hosting services to GitHub.com.

To get started with GitHub Importer, see Importing a repository with GitHub Importer.

Capabilities and limitations of GitHub Importer

  • GitHub Importer imports the source code and commit history of a repository. It does not import other associated data from the hosting service, such as issues and pull requests.
  • GitHub Importer is only available on GitHub.com.
  • During an import, you can authenticate with your remote repository. The repository must be accessible from the public internet. If the repository is hosted on a private network, GitHub Importer won't be able to access it.
  • GitHub Importer does not support repositories that use version control systems other than Git, such as Mercurial, Subversion, or Team Foundation Version Control (TFVC). For more information about alternatives to GitHub Importer, see About source code imports using the command line.
  • Repositories and individual files on GitHub are subject to size limits. For more information, see About large files on GitHub.
  • GitHub Importer does not move Git Large File Storage (LFS) objects from the source repository to the target repository. If you use Git LFS, you will need to either convert the Git LFS objects to regular files tracked by Git before running the migration, or move the Git LFS objects to the new repository separately after running the migration.

Further reading

If your source code is stored on another Git-based hosting service, you can move the code to GitHub.com using GitHub Importer.

About GitHub Importer

GitHub Importer is a tool that quickly imports Git repositories from other hosting services to GitHub.com.

To get started with GitHub Importer, see Importing a repository with GitHub Importer.

Capabilities and limitations of GitHub Importer

  • GitHub Importer imports the source code and commit history of a repository. It does not import other associated data from the hosting service, such as issues and pull requests.
  • GitHub Importer is only available on GitHub.com.
  • During an import, you can authenticate with your remote repository. The repository must be accessible from the public internet. If the repository is hosted on a private network, GitHub Importer won't be able to access it.
  • GitHub Importer does not support repositories that use version control systems other than Git, such as Mercurial, Subversion, or Team Foundation Version Control (TFVC). For more information about alternatives to GitHub Importer, see About source code imports using the command line.
  • Repositories and individual files on GitHub are subject to size limits. For more information, see About large files on GitHub.
  • GitHub Importer does not move Git Large File Storage (LFS) objects from the source repository to the target repository. If you use Git LFS, you will need to either convert the Git LFS objects to regular files tracked by Git before running the migration, or move the Git LFS objects to the new repository separately after running the migration.

Further reading

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamtriageDo not begin working on this issue until triaged by the team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions