Search code examples
gitclone

How can I git clone using http?


The caveat being that my bare repo is in the home directory - i.e. it is in ~/root.git.

I'm using this doc.

I tried

git clone http://www.domain.com/root.git

but this does not work b.c. my domain points to a folder called public_html which is at the same level in the folder hierarchy as root.git

fatal: repository not found

is the error.

Is there any way to have it look up one directory. I tried

git clone http://www.domain.com/../root.git

Solution

  • It isn't possible to access anything over HTTP if the HTTP server is not configured to serve it.

    Since your file is above the document root then, unless you introduce aliases / rewrites / etc to expose it, it is inaccessible.