Step 1: Install the ADO2GH extension of the GitHub CLI
GitHub Enterprise Importer is a collection of extensions for GitHub CLI. If this is your first migration, you'll need to install GitHub CLI and the ADO2GH extension.
-
Instale os GitHub CLI.
- Para obter instruções de instalação para GitHub CLI, veja o repositório GitHub CLI.
- Se você já tiver GitHub CLI instalado, execute
gh --versionpara garantir que esteja executando a versão 2.4.0 ou mais recente. Se você tiver uma versão mais antiga, visite o GitHub CLI repositório para obter instruções de atualização.
-
Instale os ADO2GH extension.
Shell gh extension install github/gh-ado2gh
gh extension install github/gh-ado2gh -
O ADO2GH extension of the GitHub CLI é atualizado semanalmente. Para garantir que você esteja usando a última versão, atualize a extensão.
Shell gh extension upgrade github/gh-ado2gh
gh extension upgrade github/gh-ado2gh
Sempre que precisar de ajuda com a ADO2GH extension, use o sinalizador --help com um comando. Por exemplo, gh ado2gh --help listará todos os comandos disponíveis, e gh ado2gh migrate-repo --help listará todas as opções disponíveis para o comando migrate-repo.
Step 2: Set environment variables
Before you can use the ADO2GH extension to migrate to GitHub Enterprise Cloud, you must create personal access tokens that can access the source and destination organizations, then set the personal access tokens as environment variables.
-
Make sure you have your personal access tokens for both GitHub and Azure DevOps ready. See Manage access if you haven't already created a token.
-
Set environment variables for the personal access tokens, replacing TOKEN in the commands below with the personal access tokens you previously created. Use
GH_PATfor the destination organization andADO_PATfor the source organization.-
If you're using Terminal, use the
exportcommand.Shell export GH_PAT="TOKEN" export ADO_PAT="TOKEN"
export GH_PAT="TOKEN" export ADO_PAT="TOKEN" -
If you're using PowerShell, use the
$envcommand.Shell $env:GH_PAT="TOKEN" $env:ADO_PAT="TOKEN"
$env:GH_PAT="TOKEN" $env:ADO_PAT="TOKEN"
-
-
Se você estiver migrando para GitHub Enterprise Cloud com residência de dados, por conveniência, defina uma variável de ambiente para a URL de API base para sua empresa.
Certifique-se de substituir
SUBDOMAINpelo subdomínio da sua empresa. Por exemplo, se o subdomínio da sua empresa foracme, oTARGET_API_URLvalor seráhttps://api.acme.ghe.com.-
Se você estiver usando o Terminal, use o comando
export.Shell export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
export TARGET_API_URL="https://api.SUBDOMAIN.ghe.com" -
Se você estiver usando o PowerShell, use o comando
$env.Shell $env:TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
$env:TARGET_API_URL="https://api.SUBDOMAIN.ghe.com"
Você usará essa variável com a opção
--target-api-urlem comandos executados com o GitHub CLI. -