I'm currently hosting my own git-repos for my private projects. For this, I use Apache and the standard git http-backend.
Now, a repo can be accessed under an URL like this:
http://vcs.myserver.lc/git/Repo.git
With this URL, I can push, fetch and clone to/from this repo using git. However, opening this URL in a Browser simply gives me a blank page and now I'm looking for a way to avoid this.
Instead, I'd like Apache to present a page with some infos like:
This is not a web-page, this is a git-repo. You can clone this repo using
git clone [URL]
...
It would be nice if [URL]
would be replaced with the current URL (using PHP for example), but plain HTML would be fine, too.
I know this should be possible since github does the same with their repos.
I managed to do something similar for the vcs.myserver.lc
-domain by specifying a DocumentRoot
in the VHost-config file:
DocumentRoot /srv/http/vcs/
In this path, i put a simple index.html
-file with basic instructions.
So, is their any simple way of showing an info side for browsers while the git-client can still work with the repo? Can I redirect browsers to a specific info-site?