Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: did you run git update-server-info on the server? - Not using github

1. I followed the following tutorial to setup git for web development on my private server.

Using git for Deployment

Im getting the following error while using

git push origin master

fatal: http://mysite.com/.git/info/refs?service=git-receive-pack not found: did you run git update-server-info on the server?

I followed through various questions on stackoverflow which all points to creating a repository before using git push but i already have a git repository.

2 . When i visit mysite.com/.git , the complete .git repository is displayed. How do i disable this and just enable git push to the same.

like image 756
wdphd Avatar asked Oct 21 '22 23:10

wdphd


1 Answers

A remote url like http://mysite/.git is certainly not a valid one.

It should refer to a bare repo name like, from the tutorial you reference, 'myproject/.git':

git remote set-url origin dan@server:/var/git/myproject.git

(Replace dan by the user account you used to setup a git repo in /var/www/myproject).


The OP wdphd confirms it works, but the non-bare repo isn't updated.

That is because the hook is pushing to "hub", and that remote need to be declared:

cd /var/www/myproject/.git
git remote add hub /var/git/myproject.git

(easier than editing /var/www/myproject/.git/config directly)

like image 174
VonC Avatar answered Oct 24 '22 02:10

VonC