Harrison
Harrison

Reputation: 13

Push to Gitlab returns fatal

Using a fresh Gitlab install, generated and added SSH keys to the user account, created a new project.

From a local machine, created one (1) folder, added a readme and preformed the following from the terminal:

git init
git add README
git commit -m '1_16_2013' 
git remote add origin [email protected]:root/test.git 
git push -v origin master

The push asks for the [email protected]'s password and returns:

Connection closed by 192.168.1.55
fatal: The remote end hung up unexpectedly

Do I need to add a shh key to my local machine?

Upvotes: 1

Views: 3286

Answers (1)

VonC
VonC

Reputation: 1323165

You need to have the public and private keys (id_rsa and id_rda.pub) stored on your ~/.ssh directory of your local machine.
Otherwise, any ssh to the gitlab server will ask for a password.

You also need to use the right ssh address:

[email protected]:test.git

You shouldn't have any path in front of the name of the git repo: gitolite (used by GitLab) will detect the name of the repo and will use the right repo path.

I prefer storing this information (server name, ssh user, private key...) in a ~/.ssh/config file: see "gitolite: can connect via ssh, can't clone" as an example (or "git clone git@myserver:gitolite-admin fails").

Upvotes: 1

Related Questions