#+title: Setup Git Repositories
#+author: Marko Bauhardt

I'm hosting this git repo on SDFeu.org

#+begin_src shell
 cd ~/git
 $ git init --bare the-hard-way.git
#+end_src

Creating a `post-update` hook to sync this repo to my webspace. This
let other users clone this repo in read-only mode.

I'm using the snippet from [[https://sdfeu.org/w/tutorials:scmgit-intro][SDFeu Tutorial]].

#+begin_src shell
 #!/bin/sh
 GIT_DIR=/arpa/m/mbauhardt/git/the-hard-way.git
 HTTP_DIR=/arpa/m/mbauhardt/html/git/the-hard-way.git

 # Update local repo info
 git update-server-info

 # clean
 rm -rf $HTTP_DIR
 cp -rf $GIT_DIR $HTTP_DIR

 # set correct Permissions
 for d in `find $HTTP_DIR -type d`; do
   chmod a+rx $d
 done
 for f in `find $HTTP_DIR -type f`; do
   chmod a+r $f
 done

 # display msg
 echo "Updated Public Access"
#+end_src