1

I'm given a Gitlab backup (using command gitlab-rake gitlab:backup:create from my team that doesn't have any source code file. The system team only gave me data disk that I could attach to a virtual machine. After attaching data disk I can only see .git structure which looks very much like bare repository explained here What's the -practical- difference between a Bare and non-Bare repository?

Is there a way that I can get source code file from that backup?

EagleDev
  • 1,754
  • 2
  • 11
  • 31

1 Answers1

0

Note: a GitLab backup would include bare repositories anyway.

But to get source files from a bare repository, simply clone it anywhere you want.

git clone /path/to/bare/repo.git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I did and it returned to me **You appear to have cloned an empty repository**. May I really miss something? Note that I have that backup and I attached the backup into a virtual machine (without any GitLab installed). I have Git client installed though. – EagleDev Nov 19 '19 at 05:34
  • That .git, is it the content of your attached disk, representing the backup, or is it the result of a gitlab-rake gitlab:backup:restore command (to restore GitLab)? – VonC Nov 19 '19 at 05:35
  • I took a backup, attached to my virtual machine and I could see list of all repos. Every repo has the same structure (HEAD, hooks, refs..). I did git clone ... and it cloned an empty repository and return me the message. – EagleDev Nov 19 '19 at 05:37
  • Then the GitLab backup included an empty repository in its backup. Are they *all* empty? – VonC Nov 19 '19 at 05:38
  • I'm not sure because as far as I can see, every .git dir has the same size and same structure. I did randomly clone 8-10 repos (in a backup there is around 1000 repos) but all gave me the same response that the cloned ones are empty. – EagleDev Nov 19 '19 at 05:40
  • @EagleDev And you did a restore (`gitlab-rake gitlab:backup:restore`)? – VonC Nov 19 '19 at 05:43
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/202616/discussion-between-eagledev-and-vonc). – EagleDev Nov 19 '19 at 05:44