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:

[email protected]

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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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 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 stackoverflow.com/a/10474067/6309 (from stackoverflow.com/questions/5041067/gitolite-git-clone-error, which can be interesting in your case)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.