<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Import your project from GitHub to GitLab > 原文:[https://docs.gitlab.com/ee/user/project/import/github.html](https://docs.gitlab.com/ee/user/project/import/github.html) * [Overview](#overview) * [How it works](#how-it-works) * [Import your GitHub repository into GitLab](#import-your-github-repository-into-gitlab) * [Using the GitHub integration](#using-the-github-integration) * [Using a GitHub token](#using-a-github-token) * [Selecting which repositories to import](#selecting-which-repositories-to-import) * [Mirroring and pipeline status sharing](#mirroring-and-pipeline-status-sharing) * [Improving the speed of imports on self-managed instances](#improving-the-speed-of-imports-on-self-managed-instances) # Import your project from GitHub to GitLab[](#import-your-project-from-github-to-gitlab "Permalink") 使用導入器,您可以將 GitHub 存儲庫導入 GitLab.com 或自管理的 GitLab 實例. ## Overview[](#overview "Permalink") **注意:**這些說明適用于 GitLab.com 上的用戶,但是如果您是自助 GitLab 實例的管理員,或者要從 GitHub Enterprise 導入,則必須啟用[GitHub 集成](../../../integration/github.html) . GitHub 集成是從 GitHub Enterprise 導入的唯一方法. 如果您使用的是 GitLab.com,則可以使用[個人訪問令牌](#using-a-github-token)導入 GitHub 存儲庫,但不建議使用此方法,因為該方法無法將所有用戶活動(例如問題和請求請求)與匹配的 GitLab 用戶相關聯. 如果您是自我管理的 GitLab 實例的管理員,則還可以使用[GitHub Rake 任務](../../../administration/raketasks/github_import.html)從 GitHub 導入項目,而不受 Sidekiq worker 的限制. 導入了項目的以下方面: * 倉庫描述(GitLab.com&7.7+) * Git 存儲庫數據(GitLab.com&7.7+) * 問題(GitLab.com 和 7.7+) * 拉取請求(GitLab.com&8.4+) * Wiki 頁面(GitLab.com&8.4+) * 里程碑(GitLab.com&8.7+) * 標簽(GitLab.com 和 8.7+) * 發行說明說明(GitLab.com 和 8.12+) * 拉取請求評論評論(GitLab.com&10.2+) * 定期發布和請求請求注釋 保留對拉取請求和問題的引用(GitLab.com&8.7+),并且每個導入的存儲庫都保持可見性級別,除非該[可見性級別受到限制](../../../public_access/public_access.html#restricting-the-use-of-public-or-internal-projects) ,在這種情況下,它默認為默認項目可見性. ## How it works[](#how-it-works "Permalink") 導入問題和請求請求時,導入程序會嘗試在 GitLab 實例的數據庫中查找其 GitHub 作者和受讓人(請注意,請求請求在 GitLab 中稱為"合并請求"). For this association to succeed, each GitHub author and assignee in the repository must meet one of the following conditions prior to the import: * 以前使用 GitHub 圖標登錄到 GitLab 帳戶. * 有一個 GitHub 帳戶,其[主要電子郵件地址](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address)與其 GitLab 帳戶的電子郵件地址匹配. 如果在 GitLab 的數據庫中未找到項目中引用的用戶,則將項目創建者(通常是啟動導入過程的用戶)設置為作者/受讓人,但是會添加關于該問題的注釋,其中提及原始 GitHub 作者. 如果不存在任何新的名稱空間(組),或者如果采用了名稱空間,則導入器會創建存儲庫,該存儲庫將在啟動導入過程的用戶的名稱空間下導入. 命名空間/存儲庫名稱也可以使用適當的權限進行編輯. 進口商還將在與未完成拉取請求相關的項目的分支上導入分支. 這些分支將以類似于`GH-SHA-username/pull-request-number/fork-name/branch`的命名方案導入. 與 GitHub 存儲庫相比,這可能導致分支中的差異. 有關更多技術細節,您可以參考[GitHub Importer](../../../development/github_importer.html "使用 GitHub 導入器")開發人員文檔. 有關導入過程的概述,請參閱[從 GitHub 遷移到 GitLab](https://youtu.be/VYOXuOg9tQI)的視頻. ## Import your GitHub repository into GitLab[](#import-your-github-repository-into-gitlab "Permalink") ### Using the GitHub integration[](#using-the-github-integration "Permalink") 在開始之前,請確保要映射到 GitLab 用戶的所有 GitHub 用戶都具有以下任一條件: * 使用 GitHub 圖標登錄的 GitLab 帳戶-或- * 一個 GitLab 帳戶,其電子郵件地址與 GitHub 用戶的[公共電子郵件地址](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address)匹配 用戶匹配嘗試將按該順序進行,并且如果兩種方法均未識別到用戶,則該活動將與執行導入的用戶帳戶相關聯. **注意:**如果您使用的是自助式 GitLab 實例,或者要從 GitHub Enterprise 導入,則此過程要求您已配置[GitHub 集成](../../../integration/github.html) . 1. 在頂部導航欄中,單擊**+** ,然后選擇**新建項目** . 2. 選擇**導入項目**選項卡,然后選擇**GitHub** . 3. 選擇第一個按鈕以**列出您的 GitHub 存儲庫** . 您將被重定向到[GitHub 上](https://github.com)的頁面以授權 GitLab 應用程序. 4. 點擊**授權 gitlabhq** . 您將被重定向回 GitLab 的 Import 頁面,并列出所有 GitHub 存儲庫. 5. 繼續[選擇要導入的存儲庫](#selecting-which-repositories-to-import) . ### Using a GitHub token[](#using-a-github-token "Permalink") **注意:**不建議使用個人訪問令牌導入項目. 如果您是 GitLab.com 用戶,則可以使用個人訪問令牌從 GitHub 導入項目,但是該方法無法將所有用戶活動(例如問題和請求請求)與匹配的 GitLab 用戶關聯. 如果您是自我管理的 GitLab 實例的管理員,或者要從 GitHub Enterprise 導入,則不能使用個人訪問令牌. 建議所有用戶使用[GitHub 集成方法(上述)](#using-the-github-integration) . 在" [如何工作"](#how-it-works)部分中了解更多信息. 如果您不使用 GitHub 集成,則仍可以通過 GitHub 執行授權以授予 GitLab 訪問您的存儲庫的權限: 1. 轉到[https://github.com/settings/tokens/new](https://github.com/settings/tokens/new) 2. 輸入令牌描述. 3. 選擇回購范圍??. 4. Click **生成令牌**. 5. 復制令牌哈希. 6. 返回到 GitLab 并將令牌提供給 GitHub 導入器. 7. 點擊**列出您的 GitHub 存儲庫**按鈕,并等待 GitLab 讀取您的存儲庫信息. 完成后,將帶您到導入器頁面以選擇要導入的存儲庫. ### Selecting which repositories to import[](#selecting-which-repositories-to-import "Permalink") 在授權訪問 GitHub 存儲庫后,您將重定向到 GitHub 導入程序頁面,并列出 GitHub 存儲庫. 1. 默認情況下,建議的存儲庫名稱空間與 GitHub 中存在的名稱匹配,但是根據您的權限,您可以選擇在繼續導入任何名稱之前編輯這些名稱. 2. 選擇任意數量的存儲庫旁邊的**導入**按鈕,或選擇**導入所有存儲庫** . 此外,您可以按名稱過濾項目. 如果應用了過濾器,則" **導入所有存儲庫"**僅導入匹配的存儲庫. 3. " **狀態"**列顯示每個存儲庫的導入狀態. 您可以選擇讓頁面保持打開狀態,它將實時更新,也可以稍后返回. 4. 導入存儲庫后,單擊其 GitLab 路徑以打開其 GitLab URL. [![Github importer page](https://img.kancloud.cn/53/05/5305ac0f867c86cfd6fa8eccc624e352_1265x412.png)](img/import_projects_from_github_importer_v12_3.png) ## Mirroring and pipeline status sharing[](#mirroring-and-pipeline-status-sharing "Permalink") 根據您的 GitLab 層,可以設置[項目鏡像](../repository/repository_mirroring.html) ,以使導入的項目與其 GitHub 副本保持同步. 此外,您可以配置 GitLab 以通過[GitHub Project Integration](../integrations/github.html)將管道狀態更新發送回 GitHub. 如果使用[CI / CD 作為外部存儲庫](../../../ci/ci_cd_for_external_repos/index.html)導入項目,則會自動配置以上兩項. ## Improving the speed of imports on self-managed instances[](#improving-the-speed-of-imports-on-self-managed-instances "Permalink") **注意:**必須具有對 GitLab 服務器的管理員訪問權限. 對于大型項目,可能需要一段時間才能導入所有數據. 為了減少必要的時間,您可以增加處理以下隊列的 Sidekiq 工作程序的數量: * `github_importer` * `github_importer_advance_stage` For an optimal experience, it’s recommended having at least 4 Sidekiq processes (each running a number of threads equal to the number of CPU cores) that *only* process these queues. It’s also recommended that these processes run on separate servers. For 4 servers with 8 cores this means you can import up to 32 objects (e.g., issues) in parallel. 減少克隆存儲庫所花費的時間可以通過增加存儲 Git 存儲庫(適用于您的 GitLab 實例)的磁盤的網絡吞吐量,CPU 容量和磁盤性能(例如,使用高性能 SSD)來完成. 增加 Sidekiq 工作人員的數量*不會*減少克隆存儲庫所花費的時間.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看