tech_notes

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d17a30c7f3f32cc873d24dd12fce09acf63dd947
parent 6ba1ee389c89a187d3a7dc578abcb342ba57f86d
Author: Julian Piribauer <julian@Julians-Air.fritz.box>
Date:   Mon, 16 Feb 2026 21:41:37 +0100

Clean-up of stagit note

Diffstat:
Mstagit.md | 21+++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/stagit.md b/stagit.md @@ -1,8 +1,13 @@ # Static git server +Stagit allows us to display git repositories running on a previously installed git server. + + We give the user git the home: /srv/git and store the repos as /srv/git/repos/my_repo. The web server has its root at /var/www/git/. +## Helper-script for executing stagit and stagit-index + First, we create a helper script: /usr/local/bin/update-stagit.sh: @@ -27,9 +32,11 @@ First, we create a helper script: cd "$HTML_ROOT" stagit-index "$REPO_ROOT"/*.git > index.html -make it executable: +and make it executable: chmod +x /usr/local/bin/update-git.sh +## Post-receive hook + We now set up a post-receive hook that creates the folder structure for new repos. /srv/git/template/hooks/post-receive: @@ -37,7 +44,9 @@ We now set up a post-receive hook that creates the folder structure for new repo #!/bin/sh /usr/local/bin/update-stagit.sh "$(pwd)" -Make it executable with chmod +. +Make it executable as well with chmod +. + +## Set in default template Instruct git to use it as a template: git config --system init.templateDir /srv/git/template @@ -45,3 +54,11 @@ git config --system init.templateDir /srv/git/template Finally, we give all users reading rights to all subfolders of the repo folders: chmod -R a+rX /srv/git/repos chmod -R a+rX /var/www/git + +## Usage + +New repos can now be initiated on the server with + +git init --bare my_repo + +The website and the repo endpoint will be updated upon the first push.