Search code examples
gitgitlabgitlab-omnibus

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:

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.

Within this repositories/ directory, I have managed to git clone --mirror <git-repo> which gives me the *.git I need.

How do I get Gitlab to detect this as a project, or how do I get Gitlab to add a new project using this?


Solution

  • If you want to import projects to GitLab with git you have two options:

    1. Use the built-in import capabilities, namely the import "Repo by URL". This way GitLab will do the import process for you which means creating a Project and pulling the files from a remote repository.

    2. Create a Project and pull/clone the files yourself.

    There currently is no way to just put the repositories in the folder where GitLab puts them. As GitLab has to create database entries and such only the two options above will work.