4

Context / Information

I installed gitlab on ubuntu 12.04 as described on this official page: https://github.com/gitlabhq/gitlabhq/blob/stable/doc/installation.md

After I installed, I was able to access the web interface at http://machine_ip:3000 with the credentials:

admin@local.host

5iveL!fe

On my machine, I have the following users: - git (that was set with no password as in the tutorial) - gitlab (set auto as in the tutorial) - my_username (the normal user used by me as root)

In the web interface of gitlab, when requested, I generated a public rsa key on my_username and pasted it there.

I then proceeded to create a repository in /home/my_username/test with git init and git remote add origin as in the tutorial. When I'm trying to push my commit, I get the following error:

To git@localhost:test.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@localhost:test.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

I'm telling you all this to have a better understanding of what I've tried to achieve and what error messages I'm getting.

The problem

On a developer's machine, I installed putty, pageant and puttygen and msysgit. I generated a key that was associated with a new user in gitlab's interface. Also, I set GIT_SSH to use plink in order to have msysgit use pageant (which is serving the key for connection).

I am able to connect to git@machine_ip using no passwords, so the key is added to authorized_keys in git.

However, when I try to clone the repository with source location git@machine_ip:test.git I'm getting the following error message:

fatal: 'test.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

I don't know what I'm getting wrong here. Am I supposed to do something different (creating a new project, setting a repository differently, adding a new user and their key in gitlab) etc.

Can you please provide some help?

Updated information

I solved this by reinstalling the machine using the turnkey gitlab appliance and then upgrading (with a bit of a hustle, I admit) gitlab.

Thank you everyone.

rsavu
  • 601
  • 1
  • 7
  • 11

1 Answers1

2

I would first declare the repo test through the GitLab interface itself, and clone that repo.
(instead of initializing a repo locally, and trying to push it)

As the OP rsavu mentions, using the turnkey GitLab appliance and upgrading GitLab was enough to solve the issue.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I made a new project in the gitlab and tried to clone it. I'm still getting the same "test.git" does not appear to be a git repository. – rsavu Oct 05 '12 at 08:29
  • @rsavu what does a `ssh -T git@machine_ip:test.git` returns when executed from the client you are using to try and clone that `test.git` repo? It should return the gitolite 'hello' message, like in http://stackoverflow.com/a/10474067/6309 (from http://stackoverflow.com/questions/5041067/gitolite-git-clone-error, which can be interesting in your case) – VonC Oct 05 '12 at 09:27