<h4 style="font-size:1.15em;line-height:1.3em;margin:0px 0px .25em;padding:0px;">2.5.1.&nbsp;gitolite 向 gitlab 迁移</h4><p style="padding:0px;font-family:&#39;Times New Roman&#39;;background-color:rgb(255,255,255);">早期gitlab使用gitolite为用户提供SSH服务,新版gitlab有了更好的解决方案gitlab-shell。安装新版本是必会涉及gitolite 向 gitlab 迁移,下面是我总结的一些迁移经验。</p><p style="padding:0px;font-family:&#39;Times New Roman&#39;;background-color:rgb(255,255,255);">第一步,将gitolite复制到gitlab仓库目录下</p><pre class="screen">#&nbsp;cp&nbsp;-r&nbsp;/gitroot/gitolite/repositories/*&nbsp;/var/opt/gitlab/git-data/repositories/ </pre><p style="padding:0px;font-family:&#39;Times New Roman&#39;;background-color:rgb(255,255,255);">执行导入处理程序</p><pre class="screen">#&nbsp;gitlab-rake&nbsp;gitlab:import:repos &nbsp;&nbsp;&nbsp;gitlab-rake&nbsp;gitlab:import:repos[&#39;/var/opt/gitlab/git-data/repositories&#39;]</pre><p style="padding:0px;font-family:&#39;Times New Roman&#39;;background-color:rgb(255,255,255);">上面程序会处理一下目录结构,例如</p><p style="padding:0px;font-family:&#39;Times New Roman&#39;;background-color:rgb(255,255,255);">进入gitlab web界面,创建仓库与导入的仓库同名,这样就完成了导入工作。</p><p>提示</p><table><tbody><tr class="firstRow"><td style="font-size:1em;"><img src="http://172.30.5.137/graphics/tip.png" alt="[提示]"/></td></tr><tr><td style="font-size:1em;"><p style="padding:0px;">转换最好在<a href="http://lib.csdn.net/base/28" class="replace_word" title="Git知识库" target="_blank" style="color:rgb(223,52,52);text-decoration:none;font-weight:bold;">Git</a>用户下面操作,否则你需要运行</p><pre class="screen">#&nbsp;chown&nbsp;git:git&nbsp;-R&nbsp;/var/opt/gitlab/git-data/repositories </pre></td></tr></tbody></table><p><br/></p><p><br/></p>