1

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.

4
  • Did gitlab tell you to add this remote "gitlab@gitlab.mydomain:root/testproject.git" ? – Danila Ladner Jan 23 '14 at 16:25
  • Yes, I C&P'd the message you read there and just removed the actual domain. – noamik Jan 23 '14 at 16:36
  • I don't know anything about gitlab, but I suggest that you review your gitlab configurations. Is there some kind of path variable that you need to fix so that gitlab provides the path correctly? – Zoredache Jan 23 '14 at 17:24
  • @Zoredache I didn't just check my configuration manually, I also ran all the check-scripts that were mentioned in the docu. The reason for it to no work was lack of knowledge on my end (and maybe lack of proper documentation). I ignored that you had to use keys and weren't allowed to do password authentication with the default setup of gitlab-shell (maybe it's possible to configure password authentication as well, but so far I wouldn't know how to). – noamik Jan 23 '14 at 17:41
1

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.

2
  • 1
    As I mentioned, I am not familiar with gitlab, but if using keys makes it work, then I assume the keys get a force-command added to the key or something. If that is the case, you might be able to make that work for password auth by configuring a ForceCommand for a user in your sshd_config. You really should use key-based auth though. – Zoredache Jan 23 '14 at 17:44
  • @Zoredache Thanks for the hint. The keys get indeed added a force command. I know why one should use keys instead of passwords and intend to use them when running the project. Your hint made me understand how gitlab and gitlab-shell interact a lot better. Thanks a lot for your time. – noamik Jan 23 '14 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.