繁体   English   中英

如何将现有的裸git存储库导入Gitlab?

[英]How to import an existing bare git repository into Gitlab?

导入我的裸git仓库到Gitlab被描述为在这里 ,因为它不被视为一个git仓库,而是创建了一个94K的大“空”回购(原来是2,8GB大):

$ bundle exec rake gitlab:import:repos RAILS_ENV=production
fatal: Not a git repository (or any of the parent directories): .git
Processing test.git
INFO: Sidekiq client using redis://localhost:6379 with options:namespace=>"resque:gitlab"}
 * Created test (test.git)
Done!

作为一种解决方法,我用我的裸仓库替换空项目文件夹(由导入试用版创建)。 然后我树从克隆远程克隆repo并得到以下错误:

$ git clone git@mydomain.com:...test.git
Cloning into 'test'
fatal: '...test.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是git用户应该拥有所需的所有权限。 - 也许我有一些被忽视的东西?

我的系统:RHEL6.3,Git 1.8.3.4,Gitlab5.3。

Gitlab需要一个普通的存储库(非裸)吗? 或者我的问题是什么?

Gitlab需要一个普通的存储库(非裸)吗?

不,由gitlab管理的所有回购都是裸回购。

你应该看到:

/home/git/repositories/user1/repo1.git
/home/git/repositories/user1/repo2.git
/home/git/repositories/greoup1/repo3.git
...

确保test.git文件夹(以及其中的裸存储文件)的权限与/home/git/repositories/下的现有裸/home/git/repositories/

如果导入不起作用,那么“用我的裸仓库替换空项目文件夹(由导入试验创建)”应该。

但是:你需要确保GitLab创建的空裸~git/repositories/arepo.git/hooks中的任何钩子(在~git/repositories/arepo.git/hooks )被复制到你的完整裸~git/repositories/arepo.git/hooks替换空~git/repositories/arepo.git/hooks (同一路径)。
检查~git/repositories/arepo.git/info~git/repositories/arepo.git/config

要进行调试,首先尝试克隆导入失败期间由GitLab创建的空裸存储库。
然后用自己的替换它,仔细检查钩子然后再试一次。


至于提到的OP和GitLab记录“ 故障排除指南 ”,正确的SSH网址是:

git@git.myserver.com:repositories/mygroup/proj1.git

with :repositories提到的:repositories


导入裸存储库(如下面Sytse Sijbrandijraketasks/import.md

  • 在git repos_path下复制你的裸存储库(参见config/gitlab.yml gitlab_shell -> repos_path
  • 运行以下命令

     bundle exec rake gitlab:import:repos RAILS_ENV=production 

对我来说,复制存储库的位置是 - / var / opt / gitlab / git-data / repositories

我在上面的dir中复制了我现有的裸存储库并运行> gitlab-rake gitlab:import:repos it working !!!

我有它! 这是我的ssh路径中缺少的目录。 此问题已在此处进行了跟踪。

对不起,但错误信息并不那么明显。 我希望这可以帮助像我这样的其他Gitlab初学者:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM