Return to repo list

remgit-scripts

A collection of scripts for use with a simple remote git service.
Return to HMagellan.com

commit 3882998c0ad24fb63c1728962cdb3ba3f0dea922
parent 8135e6c1c6c10f5f7c8cdecfaff38bc42a0666e8
Author: Erik Letson <hmagellan@tutamail.com>
Date:   Thu,  2 Jul 2020 23:58:16 -0500

first ver of gitnew

Diffstat:
Agitnew | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/gitnew b/gitnew @@ -0,0 +1,24 @@ +#!/bin/bash + +# Creates a new bare repo in the right place and prepares it for use +# RUN WITH ROOT PRIVELEGES FOR CORRECT CHOWN BEHAVIOUR +# TODO: add in the ability to add descriptions as well +# TODO: basic verification (names, etc.) + +# Configure to your git site's web root & the directory that contains repos therein +SITEPATH="/var/www/default" +REPODIR="git" + +if [[ -z $@ ]] +then + echo "No arguments passed. Please pass one or more names for new repos." +else + for i in $@ ; do + mkdir $SITEPATH/$REPODIR/$i + cd $SITEPATH/$REPODIR/$i + git init --bare + touch git-daemon-ok + cd $SITEPATH/$REPODIR + chown -R git:git $i + done +fi