💾 Archived View for perso.pw › blog › articles › 23.gmi captured on 2023-04-26 at 14:02:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2023-05-24)

-=-=-=-=-=-=-

How to publish a git repository on http

NIL=> Comment on Mastodon

Here is an how-to in order to make a git repository available for

cloning through a simple http server. This method only allow people to

fetch the repository, not to push. I wanted to set-up this to get my

code, I don't plan to have any commit on it from other people at this

time so it's enough.

In a folder publicly available from your http server clone your

repository in bare mode. As explained in

the [https://git-scm.com/book/tr/v2/Git-on-the-Server-The-Protocols](man page):

$ cd /var/www/htdocs/some-path/

$ git clone --bare /path/to/git_project gitproject.git

$ cd gitproject.git

$ git update-server-info

$ mv hooks/post-update.sample hooks/post-update

$ chmod o+x hooks/post-update

Then you will be able to clone the repository with

$ git clone https://your-hostname/some-path/gitproject.git

I've lost time because I did not execute **git update-server-info** so

the clone wasn't possible.