Skip to main content
ドキュメントへの更新が頻繁に発行されており、このページの翻訳はまだ行われている場合があります。 最新の情報については、「英語のドキュメント」を参照してください。

Importing from other version control systems with the administrative shell

Using the administrative shell, you can import from Subversion, Mercurial and Team Foundation Version Control to Git repositories on GitHub Enterprise Server.

この機能を使用できるユーザー

Site administrators can use the administrative shell to import data from other version control systems.

Importing projects from Mercurial

  1. お使いの GitHub Enterprise Server インスタンス に SSH で接続します。 インスタンスが複数のノードで構成されている場合は (高可用性や geo レプリケーションが構成されている場合など)、プライマリ ノードに SSH 接続します。 クラスターを使用する場合は、任意のノードに SSH 接続できます。 SSH アクセスについて詳しくは、「管理シェル (SSH) にアクセスする」をご覧ください。

    $ ssh -p 122 admin@HOSTNAME
  2. 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.
  3. /PATH/REPO-NAME.git/git-import/raw-authors.csv でコンマ区切り (CSV) ファイルを確認します。 以下の列が含まれているはずです。

    • ID: 元のリポジトリに格納されている作成者、その後に一意識別子が続きます
    • NAME: 元のリポジトリに格納されている作成者

    元のリポジトリの作成者をメール アドレスと名前にマップするには、ID,(ignored),GIT_EMAIL,GIT_NAME 列を含む新しい CSV ファイルを作成します。このファイルでは、"ID" による任意の作成者情報が "GIT_EMAIL" と "GIT_NAME" に置き換えられます。

    例:

    • 元の作成者 ID: octocat@111111-2222-3333-4444-55555555555

    • 新しいメール アドレス: octocat@github.com

    • 新しい名前: The Octocat

      オリジナルの作者を新しいGitユーザにマップするには、CSVファイルに以下の行が含まれていなければなりません。

      octocat@111111-2222-3333-4444-55555555555, ,octocat@github.com,The Octocat

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

    $ git-import-rewrite --flavor hg --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
  5. If you haven't yet, create a new empty repository on GitHub Enterprise Server.

  6. ワーキングディレクトリをローカルのリポジトリに変更します。

  7. Push the imported repository to GitHub Enterprise Server:

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

Importing projects from Subversion

  1. お使いの GitHub Enterprise Server インスタンス に SSH で接続します。 インスタンスが複数のノードで構成されている場合は (高可用性や geo レプリケーションが構成されている場合など)、プライマリ ノードに SSH 接続します。 クラスターを使用する場合は、任意のノードに SSH 接続できます。 SSH アクセスについて詳しくは、「管理シェル (SSH) にアクセスする」をご覧ください。

    $ ssh -p 122 admin@HOSTNAME
  2. 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.
  3. /PATH/REPO-NAME.git/git-import/raw-authors.csv でコンマ区切り (CSV) ファイルを確認します。 以下の列が含まれているはずです。

    • ID: 元のリポジトリに格納されている作成者、その後に一意識別子が続きます
    • NAME: 元のリポジトリに格納されている作成者

    元のリポジトリの作成者をメール アドレスと名前にマップするには、ID,(ignored),GIT_EMAIL,GIT_NAME 列を含む新しい CSV ファイルを作成します。このファイルでは、"ID" による任意の作成者情報が "GIT_EMAIL" と "GIT_NAME" に置き換えられます。

    例:

    • 元の作成者 ID: octocat@111111-2222-3333-4444-55555555555

    • 新しいメール アドレス: octocat@github.com

    • 新しい名前: The Octocat

      オリジナルの作者を新しいGitユーザにマップするには、CSVファイルに以下の行が含まれていなければなりません。

      octocat@111111-2222-3333-4444-55555555555, ,octocat@github.com,The Octocat

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

    $ git-import-rewrite --flavor svn --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
  5. If you haven't yet, create a new empty repository on GitHub Enterprise Server.

  6. ワーキングディレクトリをローカルのリポジトリに変更します。

  7. Push the imported repository to GitHub Enterprise Server:

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

Importing projects from Team Foundation Version Control

  1. お使いの GitHub Enterprise Server インスタンス に SSH で接続します。 インスタンスが複数のノードで構成されている場合は (高可用性や geo レプリケーションが構成されている場合など)、プライマリ ノードに SSH 接続します。 クラスターを使用する場合は、任意のノードに SSH 接続できます。 SSH アクセスについて詳しくは、「管理シェル (SSH) にアクセスする」をご覧ください。

    $ ssh -p 122 admin@HOSTNAME
  2. 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.
  3. /PATH/REPO-NAME.git/git-import/raw-authors.csv でコンマ区切り (CSV) ファイルを確認します。 以下の列が含まれているはずです。

    • ID: 元のリポジトリに格納されている作成者、その後に一意識別子が続きます
    • NAME: 元のリポジトリに格納されている作成者

    元のリポジトリの作成者をメール アドレスと名前にマップするには、ID,(ignored),GIT_EMAIL,GIT_NAME 列を含む新しい CSV ファイルを作成します。このファイルでは、"ID" による任意の作成者情報が "GIT_EMAIL" と "GIT_NAME" に置き換えられます。

    例:

    • 元の作成者 ID: octocat@111111-2222-3333-4444-55555555555

    • 新しいメール アドレス: octocat@github.com

    • 新しい名前: The Octocat

      オリジナルの作者を新しいGitユーザにマップするには、CSVファイルに以下の行が含まれていなければなりません。

      octocat@111111-2222-3333-4444-55555555555, ,octocat@github.com,The Octocat

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

    $ git-import-rewrite --flavor tfs --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO_NAME.git
  5. If you haven't yet, create a new empty repository on GitHub Enterprise Server.

  6. ワーキングディレクトリをローカルのリポジトリに変更します。

  7. Push the imported repository to GitHub Enterprise Server:

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

Further reading