github-docs-arabic-enhanced / content /migrations /importing-source-code /using-the-command-line-to-import-source-code /importing-from-other-version-control-systems-with-the-administrative-shell.md
AbdulElahGwaith's picture
Upload folder using huggingface_hub
88df9e4 verified
metadata
title: Importing from other version control systems with the administrative shell
intro: >-
  Using the administrative shell, you can import from Subversion, Mercurial and
  Team Foundation Version Control to Git repositories on {% data
  variables.product.prodname_ghe_server %}.
redirect_from:
  - >-
    /enterprise/admin/migrations/importing-data-from-third-party-version-control-systems
  - >-
    /enterprise/admin/user-management/importing-data-from-third-party-version-control-systems
  - >-
    /admin/user-management/importing-data-from-third-party-version-control-systems
  - >-
    /admin/user-management/migrating-data-to-and-from-your-enterprise/importing-data-from-third-party-version-control-systems
versions:
  ghes: '*'
type: how_to
topics:
  - Enterprise
  - Migration
shortTitle: Administrative shell
permissions: >-
  Site administrators can use the administrative shell to import data from other
  version control systems.

Importing projects from Mercurial

{% data reusables.enterprise_installation.ssh-into-instance %}

  1. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:

    $ git-import-hg-raw HG-CLONE-URL/PATH/REPO-NAME.git
    # Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
    

{% data reusables.enterprise_migrations.review-the-import-csv %}

  1. Rewrite the authors and branches using the CSV file:

    git-import-rewrite --flavor hg --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
    
  2. If you haven't yet, create a new empty repository on {% data variables.product.prodname_ghe_server %}. {% data reusables.command_line.switching_directories_procedural %}

  3. Push the imported repository to {% data variables.product.prodname_ghe_server %}:

    git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
    

Importing projects from Subversion

{% data reusables.enterprise_installation.ssh-into-instance %}

  1. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:

    $ git-import-svn-raw SVN-CLONE-URL /PATH/REPO-NAME.git
    # Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
    

{% data reusables.enterprise_migrations.review-the-import-csv %}

  1. Rewrite the authors and branches using the CSV file:

    git-import-rewrite --flavor svn --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
    
  2. If you haven't yet, create a new empty repository on {% data variables.product.prodname_ghe_server %}. {% data reusables.command_line.switching_directories_procedural %}

  3. Push the imported repository to {% data variables.product.prodname_ghe_server %}:

    git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
    

Importing projects from Team Foundation Version Control

{% data reusables.enterprise_installation.ssh-into-instance %}

  1. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:

    $ git-import-tfs-raw TEAM-FOUNDATION-CLONE-URL /PATH/REPO-NAME.git
    # Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
    

{% data reusables.enterprise_migrations.review-the-import-csv %}

  1. Rewrite the authors and branches using the CSV file:

    git-import-rewrite --flavor tfs --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO_NAME.git
    
  2. If you haven't yet, create a new empty repository on {% data variables.product.prodname_ghe_server %}. {% data reusables.command_line.switching_directories_procedural %}

  3. Push the imported repository to {% data variables.product.prodname_ghe_server %}:

    git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
    

Further reading