7

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?

bobobobo
  • 769
  • 6
  • 14
  • 26

4 Answers4

5

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.

asjo
  • 1,228
  • 8
  • 6
0

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

bobobobo
  • 769
  • 6
  • 14
  • 26
0

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...