我有 GitLab CE,但安装已损坏,无法启动。我如何从文件系统下载并打开所有存储库?
更新:
在 gitlab.rb 中,我有 git 存储库路径,它是:/var/opt/gitlab/git-data/repositories/,但我发现了:
FETCH_HEAD
HEAD
config
description
hooks -> /opt/gitlab/embedded/service/gitlab-shell/hooks
hooks.old.1478620628
info
objects
refs
Run Code Online (Sandbox Code Playgroud)
但没有通常的源代码存储库。
这是一个裸存储库(您可以在这个SO问题中看到非常清晰的描述)。
它不包含代码的签出副本,但您可以将其用作git clone、git fetch / pull和 的常规目标git push:
如果它与您的工作计算机位于同一台计算机上,您可以将其克隆到常规存储库:
# in your development directory :
$ git clone /var/opt/gitlab/git-data/repositories/<project-dir>
Run Code Online (Sandbox Code Playgroud)如果它位于可以通过 ssh 访问的计算机上,则可以通过 ssh 克隆它:
$ git clone user@server:/var/opt/gitlab/git-data/repositories/<project-dir>
Run Code Online (Sandbox Code Playgroud)如果您的 gitlab 已关闭,并且其他用户无法修改此存储库,则只需复制目录或制作 tar 存档即可安全:
$ cd /var/opt/gitlab/git-data/repositories/
$ tar -czf project.tgz project-dir/
# then copy this tar archive anywhere you want,
# extract it, and use it as above
Run Code Online (Sandbox Code Playgroud)上述任何一项都会为您提供当前存储库的备份,您可以使用它来恢复您的 gitlab。
| 归档时间: |
|
| 查看次数: |
1223 次 |
| 最近记录: |