My question
I'm trying to share a git repo on our company intranet server using the dumb http protocol, which should only require file access, but it fails with
fatal: repository 'http://my-url/repo.git' not found
But pasting the same link in Firefox gives me the index to the bare repo with branches/
, config
, description
, HEAD
etc. All directories and files are readable.
In fact, if I download the whole thing recursively with wget I could git clone
locally from that, so all required files seems accessible without issues.
$ wget -r --no-parent --reject "index.html*" http://my-url/repo.git
$ git clone repo.git test
Cloning into 'test'...
done.
Continuing the debugging I tried verbose output with GIT_CURL_VERBOSE
and GIT_TRACE
:
$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone http://my-url/repo.git test
trace: built-in: git 'clone' 'http://my-url/repo.git' 'test'
Cloning into 'test'...
trace: run_command: 'git-remote-http' 'origin' 'http://my-url/repo.git'
* Couldn't find host my-url in the .netrc file; using defaults
* About to connect() to my-url port 80 (#0)
* Trying <ip>...
* Connected to my-url (<ip>) port 80 (#0)
> GET /repo.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.3.1
Host: my-url
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 404 Not Found
< Date: Fri, 04 Sep 2015 13:41:56 GMT
< Server: Apache/2.2.15 (Red hat)
< shortcut-icon: /images/logo.ico
< Content-Length: 346
< Content-Type: text/html; charset=iso-8859-1
< X-Cache: MISS from my-url
<
* Connection #0 to host my-url left intact
fatal: repository 'http://my-host/repo.git/' not found
And to me it looks like it gives up after trying the "smart" http protocol. So, what's going on? From what I've been able to gather the dumb http protocol hasn't been dropped. Why does git
give up after trying the smart http?
Details
- HTTP Server is Apache 2.2.15
- Anonymous read access via HTTP is allowed
- git version 1.8.3.1
- The repo is bare and is not symlinked
git update-server-info
has manually been called.- I don't have access to the server and can't configure it, so the "smart http" option is out.
- The only thing in any (global, system, local) git-config is
user.name
anduser.email
. env | grep GIT
is empty- The results are the same for
https
.
Edit: Updated with results for https (same)
Similar questions
Similar question but without answers that are helpful in this case: Git Clone - Repository not found
Also similar, but the accepted answer uses "smart http" protocol.
git clone
over HTTP Fails with “repository not found”