Gui13
Gui13

Reputation: 13541

Publish Git repo on a web-only provider (no shell)

I have this repository that I'd like to share but not necessarily by putting it on github or other Git hosting providers.

My website is hosted at a provider (OVH) which only gives ftp access, no ssh or shell available.

My question is: is it possible to make a read-only git repository available with this provider, only using http?

If yes, how? And then, what would be the command to issue if I want to clone this repo back to my desktop?

Thanks!

Upvotes: 1

Views: 1476

Answers (3)

Jakub Narębski
Jakub Narębski

Reputation: 323444

Perhaps this would help:

They are quite old, but hopefully not outdated.

Upvotes: 0

Felix Kling
Felix Kling

Reputation: 816364

Update:

See also the Git Book - Setting up a public repository:

All you need to do is place the newly created bare git repository in a directory that is exported by the web server, and make some adjustments to give web clients some extra information they need:

$ mv proj.git /home/you/public_html/proj.git
$ cd proj.git
$ git --bare update-server-info
$ chmod a+x hooks/post-update

Advertise the URL of proj.git. Anybody else should then be able to clone or pull from that URL, for example with a command line like:

$ git clone http://yourserver.com/~you/proj.git

It should work by just creating a bare git repository and put it in your webspace. git can handle http URLs. See git-clone:

In general, URLs contain information about the transport protocol, the address of the remote server, and the path to the repository. Depending on the transport protocol, some of this information may be absent.

Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols. The following syntaxes may be used with them:

ssh://[user@]host.xz[:port]/path/to/repo.git/

git://host.xz[:port]/path/to/repo.git/

http[s]://host.xz[:port]/path/to/repo.git/

ftp[s]://host.xz[:port]/path/to/repo.git/

rsync://host.xz/path/to/repo.git/

Upvotes: 4

VeroLom
VeroLom

Reputation: 3934

Maybe gitweb can help you.

Upvotes: 0

Related Questions