Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I followed this example to set up a git repository on my server. It worked, and I successfully pushed my code to it.

But now, how do I pull or clone?

Using the docs, I tried

git clone http://REMOTE_SERVER/home/git/example.git

.. But for me, I'm getting:

fatal: http://myserverip/home/git/example.git/info/refs not found: did you run git update-server-info on the server?

I ran git-update-server info, but nothing changed

Edit:

Ah, hold on. I changed it to git clone ssh://REMOTE_SERVER/home/git/example.git and I'm getting something.. it wants my user/pass, but how do I make the server public then not requiring login?

share|improve this question

4 Answers 4

If you want to serve it via (simple) http, you need to run git-update-server-info in the repository on the server after each update.

You can automate that by making the post-update hook run it (usually the default post-update hook just needs to be enabled (make the script executable)).

With a little more configuration of your webserver git-http-backend can give you better performance.

share|improve this answer

Ah, wait, I got it, this explains how to do it using git-daemon:

SERVER:

  • Start up git-daemon &
  • touch git-daemon-export-ok

CLIENT:

git clone git://myserverip/home/git/example.git

share|improve this answer

In all my git talks I speak of DAV as the "Loch Ness monster" -- I've heard it exists but have not actually seen it :-)

And as of late last year, with git-http-backend, you no longer need this "monster". Please upgrade past 1.6.6 and treat yourself to a much better experience. No more DAV... just plain apache with a smart little CGI talking to real git...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.