gitlab-ce 12.X : how do I find the hashed storage path of a repository on the server?

标签 git gitlab gitlab-ce

使用 gitlab-ce-12.x,Geo 需要散列存储路径( https://docs.gitlab.com/ee/administration/repository_storage_types.html )

因此,对于给定的存储库,数据将存储在:
"@hashed/#{hash[0..1]}/#{hash[2..3]}/#{hash}.git"

从实际的角度来看,假设我有一个存储库,其 URL 是

https://my-gitlab-server/Group1/project1.git



如何找出服务器上存储的路径?
即我如何找到的值(value)

#{hash[0..1]}/#{hash[2..3]}/#{hash}



谢谢

最佳答案

我找到了我的问题的答案。

为了获取项目的哈希存储位置,您首先需要获取项目存储库的项目 id。

获得该项目 ID 后,假设您的项目 ID 为 1,
你这样得到哈希:

说 project.id 是 1

echo -n 1 | sha256sum



=> 你得到了 HASH
6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b

因此,服务器上存储库的散列存储位置将是:

server/@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git



这已被 gitlab 开发人员讨论过
https://gitlab.com/gitlab-org/gitlab-ce/issues/63250

关于gitlab-ce 12.X : how do I find the hashed storage path of a repository on the server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57242592/

相关文章:

git - git 如何向预提交 Hook 显示不同的索引?

azure - 在 Jenkins 中从 Azure 拉取请求构建?

GitLab 5.0 : Git push via SSH fails, 但 HTTPS 或直接 SSH 连接没有错误

git - 为什么 Gitlab 无法从本地网络导入存储库,状态码为 128?

python - 创建 virtualenv 后无法 git 添加 env/bin 目录

python - 使用 PyGitHub 在特定提交处获取存储库的所有文件内容

git checkout <提交> 。不删除提交后添加的文件

git - 如何从终端使用 Gitlab 的问题?

git - 如何在 gitlab 中更改现有 merge 请求的源分支?

docker - 错误 : Job failed: command terminated with exit code 1