Depending on version, GitLab uses one of the several storage types.
Legacy storage (default for GitLab < 10.0) type uses this naming scheme:
#{namespace}/#{project_name}.git |
Since version 10.0 GitLab uses hashed storage with the following structure:
@hashed/#{hash[0..1]}/#{hash[2..3]}/#{hash}.git |
This hash is SHA-256 of the project ID. To find the project ID, go to Setting > General:
For example, in our case the project ID is “1”. So to find a hash of it run:
$ echo -n 1 | sha256sum 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b |
Hence for our example the repository path is
/var/opt/gitlab/git-data/repositories/@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git |
If we were using Legacy Storage, the path for the example repository path would be:
/var/opt/gitlab/git-data/repositories/username/kafka.git |
where username is name of the user in GitLab (“root” for our example).