Having gitlab successfully installed and running, I tried to import an existing project. To do so I created an empty project and then got a list of instructions on the projects page, how to push my existing repo data into the gitlab project:
cd existing_git_repo
git remote add origin gitlab@gitlab.mydomain:root/testproject.git
git push -u origin master
But when doing so, I get the following message:
fatal: 'root/testproject.git' does not appear to be a git repository
fatal: Could not read from remote repository.
When looking into my repositories folder, the repository has been created there by gitlab and when using the http-URL instead of the git-URL everything is working as expected.
How is git push supposed to know how to resolve from "gitlab@gitlab.mydomain:root/testproject.git" to "gitlab@gitlab.mydomain:/home/gitlab/repositories/root/testproject.git"? Is gitlab supposed to create the git server? If so, where should I start digging to find out why no repository is found where gitlab told me to point my remote at?
–
Edit: when greping for "root/testproject.git" I get the following results:
[gitlab@gitlab gitlab]# grep -r "root/testproject.git" *
gitlab/log/sidekiq.log:Initialized empty Git repository in /home/gitlab/repositories/root/testproject.git/
gitlab-shell/gitlab-shell.log:I, [2014-01-23T16:38:16.974051 #5390] INFO -- : Adding project root/cashio.git at </home/gitlab/repositories/root/testproject.git>.
Edit2: If that helps: using git remote set-url gitlab gitlab@gitlab.mydomain:/home/gitlab/repositories/root/testproject.git instead works as expected.
Best Answer
Ok, the reason was pretty simple but not obvious to me. Everything is described here: https://github.com/gitlabhq/gitlabhq/issues/3686
It boils down to: one has to use keys with gitlab-shell and have gitlab manage these keys which I didn't know. When using key-authentication and having the keys stored using the gitlab-webinterface, pushing, pulling and cloning now works as expected.