Reputation: 4255
Background:
GitLab CE is installed on a personal Ubuntu server.
Problem:
As per GitLab's documentation here, the default path for storing git files is var/opt/gitlab/git-data
, however when I access this file, it does not really have the files from my repository. It has .git
files, which I don't know what they are and is no what I am looking for.
For example, if my repository is named hard_work
, then when I ls
with:
sudo ls /var/opt/gitlab/git-data/repositories/data/hard_hork.git
I find:
HEAD config description gitlab-worktree hooks hooks.old.1260608859 info language-stats.cache objects packed-refs refs
Question:
Where are the actual contents of my repository (the files and folders which I see when I git clone
or via the web browser.
Upvotes: 0
Views: 1143
Reputation: 1865
As mentioned by someone else in the comment, what you're seeing with ls
is the bare repository. See this post one the difference between bare and non-bare repository.
If you want to be able to browse the bare repository directly on your server (not sure why you would want to do that if you can access the repository on gitlab), you can use git ls-tree
to list the files and git cat-file
to inspect the objects:
sudo git --git-dir /var/opt/gitlab/git-data/repositories/data/hard_hork.git ls-tree --full-tree -r master
sudo git --git-dir /var/opt/gitlab/git-data/repositories/data/hard_hork.git git-cat -p <blob>
In case you need to use the scripts from your repository on the Ubuntu Server, you should clone the repository somewhere on the server, that way you will be able to see the files. Note that the cloned folder will not be "synchronized" with the GitLab repository, you will need to update it manually (or in your cron job).
Upvotes: 1