Re: git clone through http

Samuel Bronson <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Simon Marchi <[email protected]> writes:

> Hello,
>
> Cloning the binutils-gdb repository using the http address
> (http://sourceware.org/git/binutils-gdb.git) doesn't seem to work.
>
> $ git clone http://sourceware.org/git/binutils-gdb.git
> Cloning into 'binutils-gdb'...
> error: Unable to get pack index
> http://sourceware.org/git/binutils-gdb.git/objects/pack/pack-40a278cd270f8215e6b993869d659b2aff311eb8.idx
[...]

Such messages indicate that, in order for http access to work, someone
either needs to:

  1. Rename/copy the file "hooks/post-update.sample" in the repository
     to "hooks/post-update" to allow use of the "dumb" git protocol.
     (In case the file is missing, or for the lazy but still curious, I
     have also appended a copy to this message.)

or

  2. Somehow set up a "smart" web-based git server.  This seems to
     involve git-http-backend(1); for Apache, there are directions at
     <http://sethrobertson.github.io/HowToPutGitOnTheWeb/GitOnTheWeb.html#aro>
     (and earlier parts of that page).

Choice 2 is clearly more complicated and more httpd-specific, but also
more efficient in most cases.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
post-update.sample (text/x-sh, 189 B)
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".

exec git update-server-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.