Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab: Can't push code to server?

Tags:

git

ssh

gitlab

I've installed GitLab on an Ubuntu Server. Everything seems to work fine except I can't push/pull/clone to/from the server.

When I push I get the general error message:

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've tried everything from hours of googling, but I can't seem to locate a problem.

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

Runs fine, OK across the board!

I can SSH into [email protected] I get:

PTY allocation request failed on channel 0
Welcome to GitLab, Anonymous!

When I do:

ssh [email protected] "ls /location/of/git/dir"

I get:

Not allowed command

The website is running, when I create a repository on the site it appears in /home/git/repository/

But I still can't push to it.

I followed this guide:

https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md

and this guide to get it running on apache:

http://shanetully.com/2012/08/running-gitlab-from-a-subdirectory-on-apache/

like image 623
Joakim Engstrom Avatar asked Apr 01 '13 15:04

Joakim Engstrom


People also ask

Why is GitHub push not working?

You need to use git pull and resolve the difference between your local changes and the remote changes before you can git push . There is still a commit in the remote branch initializing the repo that may not be in your local version.


2 Answers

I finally figured it out after many hours of debugging, and I somehow knew there was a simple issue with the configuration.

Since the second guide mention how to set up gitlab on apache with a relative url you actually have to do some more configs inside gitlab. I uncommented the line about relative url:s unicorn.rb and in gitlab-shell/config I added my whole URL (with subdirectory).

Before:

 http://web-adress.com/

after:

 http://web-adress.com/subdomain/

Now it works great.

like image 187
Joakim Engstrom Avatar answered Sep 28 '22 14:09

Joakim Engstrom


You can test it with the command bellow. When you login it should say your name.

ssh -T [email protected]

Welcome to GitLab, Christian Hammer!

If it says "Welcome to GitLab, Anonymous!" gitlab does not recognise you as a user of gitlab.

like image 21
Troy Klein Avatar answered Sep 28 '22 15:09

Troy Klein