0
votes

I have GitLab CE, but install is damaged and i can't start it. How i can download and open all repositories from file system?

UPDATE:

In gitlab.rb i have git repositories path and it is: /var/opt/gitlab/git-data/repositories/, but there is what i've found:

FETCH_HEAD
HEAD
config
description
hooks -> /opt/gitlab/embedded/service/gitlab-shell/hooks
hooks.old.1478620628
info
objects
refs

But there are no usual repository with source codes.

1
It’s configurable where the repositories are stored. See this documentation. You should check what you have configured, and then go there. There should be a file structure of hopefully normal GIt repositories there (I don’t have GitLab, so I don’t know if that’s the case).poke
This looks like a repository. Have you actually tried to find your repositories?Fairy
Gitlab will store bare repositories, and this looks exactly like one. A bare repository will just hold the content of the .git/ folder, and will not have a checkout of your code.LeGEC
So, where i can find real repository in case when my gitlab is broken?dikkini

1 Answers

4
votes

This is a bare repository (you can see a pretty clear description in this SO question).

It does not contain a checkout copy of your code, but you can use it as a regular target for git clone, git fetch / pull, and git push :

  • If it is on the same computer as your working computer, you can clone it to a regular repository :

    # in your development directory :
    $ git clone /var/opt/gitlab/git-data/repositories/<project-dir>
    
  • If it lies on a computer which you can access through ssh, you can clone it through ssh :

    $ git clone user@server:/var/opt/gitlab/git-data/repositories/<project-dir>
    
  • If your gitlab is down, and no other user can possibly modify this repo, it is safe to simply copy the directory, or make a tar archive :

    $ 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
    

Any of the above will also give you a backup of your current repo, which you can use to restore your gitlab afterwards.