简体   繁体   English

如何安装Gitlab CE,以检测自定义git_data_dirs目录中的git repos

[英]How do I get my Gitlab CE installation to detect git repos in custom git_data_dirs directory

I have a local installation of Gitlab CE on a Vagrant box (installed there as a means of demoing to the dev team and shot-callers) and I've configured the git_data_dirs setting as follows: 我在Vagrant盒子上进行了本地安装的Gitlab CE(作为向开发团队和shot- git_data_dirs进行演示的一种方式安装在该盒子上),并且按如下所示配置了git_data_dirs设置:

git_data_dirs({"default" => "/var/git"})

Inside this directory, there is another called repositories , which I can only assume Gitlab has added when I ran sudo gitlab-ctl reconfigure . 在此目录中,还有另一个称为repositories ,我只能假设在运行sudo gitlab-ctl reconfigure时已添加了sudo gitlab-ctl reconfigure

Within this repositories/ directory, I have managed to git clone --mirror <git-repo> which gives me the *.git I need. 在这个repositories/目录中,我设法git clone --mirror <git-repo> ,这给了我所需的*.git

How do I get Gitlab to detect this as a project, or how do I get Gitlab to add a new project using this? 如何使Gitlab将其检测为项目,或者如何使Gitlab使用此项目添加新项目?

If you want to import projects to GitLab with git you have two options: 如果要使用git将项目导入到GitLab,则有两种选择:

  1. Use the built-in import capabilities, namely the import "Repo by URL". 使用内置的导入功能,即导入“ URL回购”。 This way GitLab will do the import process for you which means creating a Project and pulling the files from a remote repository. 这样,GitLab将为您完成导入过程,这意味着创建项目并从远程存储库中提取文件。

  2. Create a Project and pull / clone the files yourself. 创建一个项目,然后自己pull / clone文件。

There currently is no way to just put the repositories in the folder where GitLab puts them. 当前无法将存储库仅放在GitLab放置它们的文件夹中。 As GitLab has to create database entries and such only the two options above will work. 由于GitLab必须创建数据库条目,因此只有上面的两个选项有效。

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

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