<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Migrating from SVN to GitLab > 原文:[https://docs.gitlab.com/ee/user/project/import/svn.html](https://docs.gitlab.com/ee/user/project/import/svn.html) * [Overview](#overview) * [Smooth migration with a Git/SVN mirror using SubGit](#smooth-migration-with-a-gitsvn-mirror-using-subgit) * [SubGit prerequisites](#subgit-prerequisites) * [SubGit configuration](#subgit-configuration) * [Initial translation](#initial-translation) * [SubGit licensing](#subgit-licensing) * [SubGit support](#subgit-support) * [Cut over migration with svn2git](#cut-over-migration-with-svn2git) * [Contribute to this guide](#contribute-to-this-guide) # Migrating from SVN to GitLab[](#migrating-from-svn-to-gitlab "Permalink") Subversion(SVN)是中央版本控制系統(VCS),而 Git 是分布式版本控制系統. 兩者之間有一些主要區別,有關更多信息,請咨詢您喜歡的搜索引擎. ## Overview[](#overview "Permalink") SVN 到 Git 遷移的方法有兩種: 1. [Git/SVN Mirror](#smooth-migration-with-a-gitsvn-mirror-using-subgit) which: * 使 GitLab 存儲庫鏡像 SVN 項目. * Git 和 SVN 存儲庫保持同步; 您可以使用任何一個. * 簡化遷移過程并允許管理遷移風險. 2. [Cut over migration](#cut-over-migration-with-svn2git) which: * 將現有數據和歷史記錄從 SVN 轉換并導入到 Git. * 是一勞永逸的方法,對較小的團隊有用. ## Smooth migration with a Git/SVN mirror using SubGit[](#smooth-migration-with-a-gitsvn-mirror-using-subgit "Permalink") [SubGit](https://subgit.com)是用于平穩,無壓力的 SVN 到 Git 遷移的工具. 它創建本地或遠程 Subversion 存儲庫的可寫 Git 鏡像,并且您可以根據需要同時使用 Subversion 和 Git. 它需要直接在文件系統級別與 Git 存儲庫通信時訪問您的 GitLab 服務器. ### SubGit prerequisites[](#subgit-prerequisites "Permalink") 1. 安裝 Oracle JRE 1.8 或更高版本. 在基于 Debian 的 Linux 發行版上,您可以閱讀[本文](http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html) . 2. 從[https://subgit.com/download](https://subgit.com/download)下載 SubGit. 3. 將下載的 SubGit zip 存檔解壓縮到`/opt`目錄. `subgit`命令將在`/opt/subgit-VERSION/bin/subgit` . ### SubGit configuration[](#subgit-configuration "Permalink") 在 GitLab 中鏡像 SVN 存儲庫的第一步是創建一個新的空項目,該項目將用作鏡像. 對于 Omnibus 安裝,默認情況下,存儲庫的路徑將位于`/var/opt/gitlab/git-data/repositories/USER/REPO.git` . 對于從源安裝,默認的存儲庫目錄將是`/home/git/repositories/USER/REPO.git` . 為方便起見,將此路徑分配給變量: ``` GIT_REPO_PATH=/var/opt/gitlab/git-data/repositories/USER/REPOS.git ``` SubGit 將使該存儲庫與遠程 SVN 項目保持同步. 為了方便起見,請將您的遠程 SVN 項目 URL 分配給一個變量: ``` SVN_PROJECT_URL=http://svn.company.com/repos/project ``` 接下來,您需要運行 SubGit 來設置 Git / SVN 鏡像. 確保代表擁有 GitLab Git 存儲庫所有權的同一用戶運行以下`subgit`命令(默認情況下為`git` ): ``` subgit configure --layout auto $SVN_PROJECT_URL $GIT_REPO_PATH ``` 如有必要,請調整作者和分支機構的映射. 用您喜歡的文本編輯器打開: ``` edit $GIT_REPO_PATH/subgit/authors.txt edit $GIT_REPO_PATH/subgit/config ``` 有關 SubGit 配置選項的更多信息,請參閱[SubGit 文檔](https://subgit.com/documentation/)網站. ### Initial translation[](#initial-translation "Permalink") 現在,SubGit 已經配置了 Git / SVN 存儲庫,運行`subgit`來執行將現有 SVN 修訂版初始轉換為 Git 存儲庫的操作: ``` subgit install $GIT_REPO_PATH ``` 初始翻譯完成后,Git 存儲庫和 SVN 項目將通過`subgit`保持同步-新的 Git 提交將轉換為 SVN 修訂版,而新的 SVN 修訂版將轉換為 Git 提交. Mirror 透明地工作,不需要任何特殊命令. 如果您希望使用`subgit`執行一次性遷移,請使用`import`命令而不是`install` : ``` subgit import $GIT_REPO_PATH ``` ### SubGit licensing[](#subgit-licensing "Permalink") 以鏡像模式運行 SubGit 需要[注冊](https://subgit.com/pricing) . 開源,學術和啟動項目免費注冊. ### SubGit support[](#subgit-support "Permalink") 對于與 SubGit 的 SVN 到 GitLab 遷移有關的任何問題,您可以直接通過[support@subgit.com](mailto:support@subgit.com)與 SubGit 團隊[聯系](mailto:support@subgit.com) . ## Cut over migration with svn2git[](#cut-over-migration-with-svn2git "Permalink") 如果當前正在使用 SVN 存儲庫,則可以將該存儲庫遷移到 Git 和 GitLab. 我們建議您進行一次硬性轉換-運行一次遷移命令,然后讓所有開發人員立即開始使用新的 GitLab 存儲庫. 否則,很難保持雙向同步更改. 轉換過程應在本地工作站上運行. 安裝`svn2git` . 在所有系統上,如果已經安裝了 Ruby 和 Git,則可以作為 Ruby gem 安裝. ``` sudo gem install svn2git ``` 在基于 Debian 的 Linux 發行版上,您可以安裝本機軟件包: ``` sudo apt-get install git-core git-svn ruby ``` (可選)準備一個 authors 文件,以便`svn2git`可以將 SVN 作者映射到 Git 作者. 如果您選擇不創建作者文件,則提交將不會歸因于正確的 GitLab 用戶. 有些用戶可能不會認為這是一個大問題,而另一些用戶則希望確保他們完成此步驟. 如果選擇映射作者,則將需要映射 SVN 信息庫中的更改中存在的每個作者. 否則,轉換將失敗,您將必須相應地更新作者文件. 以下命令將搜索存儲庫并輸出作者列表. ``` svn log --quiet | grep -E "r[0-9]+ \| .+ \|" | cut -d'|' -f2 | sed 's/ //g' | sort | uniq ``` 使用最后一條命令的輸出來構造作者文件. 創建一個名為`authors.txt`的文件,并在每行添加一個映射. ``` janedoe = Jane Doe <janedoe@example.com> johndoe = John Doe <johndoe@example.com> ``` 如果您的 SVN 儲存庫為標準格式(主干,分支,標簽,而非嵌套),則轉換很簡單. 對于非標準存儲庫,請參見[svn2git 文檔](https://github.com/nirvdrum/svn2git) . 以下命令將檢出存儲庫并在當前工作目錄中進行轉換. 在運行`svn2git`命令之前,請確保為每個存儲庫創建一個新目錄. 轉換過程將需要一些時間. ``` svn2git https://svn.example.com/path/to/repo --authors /path/to/authors.txt ``` 如果您的 SVN 信息庫需要用戶名和密碼,請在上述命令中添加`--username <username>`和`--password <password>`標志. `svn2git`還支持排除某些文件路徑,分支,標簽等.請參閱[svn2git 文檔](https://github.com/nirvdrum/svn2git)或運行`svn2git --help`以獲取有關所有可用選項的完整文檔. 創建一個新的 GitLab 項目,您最終將在其中推送轉換后的代碼. 從項目頁面復制 SSH 或 HTTP(S)存儲庫 URL. 將 GitLab 存儲庫添加為 Git 遠程,并推送所有更改. 這將推送所有提交,分支和標簽. ``` git remote add origin git@gitlab.com:<group>/<project>.git git push --all origin git push --tags origin ``` ## Contribute to this guide[](#contribute-to-this-guide "Permalink") 我們歡迎所有將擴展本指南的貢獻,其中包括有關如何從 SVN 和其他版本控制系統進行遷移的說明.
                  <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>

                              哎呀哎呀视频在线观看