GitLab v5.0 git push problems

git, gitlab, ssh-keys, ubuntu-12.04

Solution

When the SSH Key got added in the GitLab frontend I noticed it was not being added accordingly in the `/home/git/.ssh/authorized_keys` file. After some digging I found this https://github.com/gitlabhq/gitlabhq/issues/3120 which points out to run the following rake:

rake gitlab:shell:setup RAILS_ENV=production

Note: the reference leaves out the part `RAILS_EVN=production` but that is required so you don't get another error stating `cannot load such file -- rb-inotify`

As my git user does not have `sudo` access I had to run the above command from another user login with sudo and then run the following to give the proper permissions (git) back to the .ssh directory:

$ sudo chgrp -R git /home/git/.ssh
$ sudo chown -R git /home/git/.ssh

After all that, go back to the GitLab frontend, delete and recreate your SSH-Key (you can use the same public key as before).

You should see the correct record in `/home/git/.ssh/authorized_keys` and if you run `git push -v -u origin master` from your local machine you should be good now!

Problem

I'm creating this question to help others in their search for documentation regarding two GitLab configuration problems when attempting to push an initialized repo: 1: the git user on your GitLab server requires password even after setting up an SSH Key in the GitLab frontend: ``` $ git push -u origin master git@hostname's password: ``` 2: the gitlab-shell client seems to look in the wrong place for your repo when attempting to push (`/home/git/repositories` is where all repositories should be stored as specified in `/home/git/gitlab-shell/config.yml`): ``` $ git push -v -u origin master Pushing to git@hostname:sadmicrowave/test-project.git fatal: 'sadmicrowave/test-project.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly ```

Original source