在服务器中,找到了/var/opt/gitlab/git-data/repositories 这个存放项目的目录,但是在里面没有找到项目的源代码。
项目源代码是存放在了什么位置?
目录没问题,只不过是hash算法转换后存储的,可以按照下面方式获取其源代码:
git clone /var/opt/gitlab/git-data/repositories/@hashed/6a/ff/6affdae3b3c1aa6aa7689e9b6a7b3225a636aa1ac0025f490cca1285ceaf1487.git
谢谢解答。但是还有个疑问 @hashed/后面的应该是一个文件地址吧。
就是假如说一种极端情况,GitLab启动不了了,我如法查看项目的地址,在这种情况下有没有办法获得repositories 存放所有项目的地址将代码clone出来。
每个hash仓库的config文件里面都有项目的fullpath,也就知道了项目所属群组和项目本身的path,剩下的就是写脚本遍历和循环。
样例:
find /var/opt/gitlab/git-data/repositories/@hashed -name config|grep -v wiki|xargs -I A cat A|grep fullpath