gitlab服务器上的git存储库位置缺少数据

gitlab服务器上的git存储库位置缺少数据

本文介绍了gitlab服务器上的git存储库位置缺少数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管我有几个项目已推送到gitlab网址上,但Gitlab服务器的存储库为空

Gitlab server has a empty repository though i have couple of project pushed onto the gitlab url

我已经使用docker-compose文件创建了一个gitlab服务器.git实验室设置成功,我登录控制台,创建了一个新组,然后创建了新项目,然后将示例文档推送到了新的存储库中.

I have created a gitlab server, using docker-compose file. The git lab is setup successfully, i logged into the console, created a new group, then new project and then pushed a sample docs into the new repository.

我可以在导航栏中从gitlab控制台中查看数据:

I can see the data from gitlab console at the navigation:

http://<URL>:8888/devops-group/maven/tree/master

但是,当我登录到服务器并转到以下路径时,我看不到任何数据:

However, when i login to the server and i go to the below path i do not see any data:

root@gitlab:/var/opt/gitlab/git-data/repositories# pwd
/var/opt/gitlab/git-data/repositories
root@gitlab:/var/opt/gitlab/git-data/repositories# ls -ltr
total 0
drwxr-s---. 3 git root 16 Aug 15 02:36 @hashed
root@gitlab:/var/opt/gitlab/git-data/repositories#

在使用docker-compose创建gitlab时,我使用了以下代码

while creation of gitlab using docker-compose i have used below code

  volumes:
   - '/srv/gitlab/config:/etc/gitlab'
   - '/srv/gitlab/logs:/var/log/gitlab'
   - '/srv/gitlab/data:/var/opt/gitlab'

无论我将任何项目或代码推送到存储库中,我都应该能够在服务器上看到它们.另外,我需要创建git挂钩,因此我需要在gitlab服务器上使用此路径.请帮助我在服务器上找到我的项目的存储库位置.

Whatever the projects or code i have pushed onto the repository, I should be able to see them on the server.Also i need to create git hooks therefore i need this path location on the gitlab server. Please help me to find the repository location for my projects on the server.

推荐答案

首先在服务器上的/srv/gitlab/config 中检查您的 gitlab.rb 配置文件).

Check first your gitlab.rb configuration file in /srv/gitlab/config (on your server).

A 默认值之一将包括设置为/home/git/repositories/的存储空间.

A default one would include a storage set to /home/git/repositories/.

如果该路径不是以/srv/gitlab/data 开头,那将解释为什么没有任何内容映射到/var/opt/gitlab .

If that path does not start with /srv/gitlab/data, that would explain why nothing is mapped to /var/opt/gitlab.

选中"运行图像"

这些卷定义背后的想法是在Docker主机上存储和持久化数据.确保文件夹/src/gitlab/xxx 存在并且可写.

The idea behind those volume definitions is to store and persists data on the Docker host. Make sure the folder /src/gitlab/xxx exist and are writable.

这篇关于gitlab服务器上的git存储库位置缺少数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 19:38