Setup a Git Http Server read-only for Public Access

October 14th, 2011 by Regaz
  1. Setup for a Hosted Remote Server
    You need SSH Access to the Server.
    ssh -p yourSSHAPort yourUserName@yourDomain
    cd path/To/yourProject.git
    mv hooks/post-update.sample hooks/post-update
    chmod a+x hooks/post-update

    Latest you need to make Git Aware of the New Setup by:

    git update-server-info

    You are Done!
    This is enough to activate the Public Http Access on Git Repository.

  2. Setup on Localhost
    Evidently your skip SSH Access :)
    After you completed all others Step as in Remote
    You need to Set an Appropriate Repository Group by:
    chgrp -R www-data path/To/yourProject.git/..

    And Restart Apache

Now everybody should be Able to Clone your Repo over Http running:

git clone http://yourDomain/path/To/yourProject.git
(Visited 1 times, 1 visits today)

Tags: ,