I am trying to import a bare git repository containing vendor code into an Omnibus installation. The rake task fails silently.
I’ve done the following
# sudo -u git mkdir -p /var/opt/gitlab/git-data/repository-import-2018-01-09/
# cd /var/opt/gitlab/git-data/repository-import-2018-01-09/
# git clone --bare ssh://git@vendor/repo
# gitlab-rake -v gitlab:import:repos
If I add ‘-t’ to the ‘bundle exec rake’ command in /opt/gitlab/bin/gitlab-rake, I get the following output
** Invoke gitlab:import:repos (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:import:repos
How can I import my repository into GitLab?
It was a permissions issue.
I’m having the same issue. What were exactly the permissions that fixed this for you? @aglauser
Looking back at my notes, I think the thing that made the difference was to set the ownership of the repo to be imported.
This was all on a very old version of GitLab (8.x?), so YMMV.
git clone --bare ssh://firstname.lastname@example.org/importRepo
chown -R git:git /path/to/importRepo
As a user in the git group
Note: The first time the
gitlab:import:repos task was run, some repositories appeared to be deleted from the GitLab UI. It would show up as an empty project.
I found a bug report of people having similar issues. It seems that clicking the “create new empty bare repo” fixes the setting(s) and allows GitLab to access the stored repository again.
Hope this helps!