git-scripts

Scripts for managing (sta-)git repos
git clone git://git.christianermann.dev/git-scripts
Log | Files | Refs | LICENSE

repo-init.sh (465B)


      1 #! /bin/sh
      2 
      3 CONFIG_PATH="/home/git/config.rc"
      4 . "${CONFIG_PATH}"
      5 
      6 REPO="$1"
      7 DESC="${2:-$DEFAULT_DESCRIPTION}"
      8 OWNER="${3:-$DEFAULT_OWNER}"
      9 
     10 REPO_PATH="${GIT_ROOT}/${REPO}"
     11 
     12 git init --bare "${REPO_PATH}"
     13 printf "%s\n" "${OWNER}" > "${REPO_PATH}/owner"
     14 printf "%s\n" "${DESC}" > "${REPO_PATH}/description"
     15 touch "${REPO_PATH}/git-daemon-export-ok"
     16 
     17 cp "${GIT_ROOT}/template/post-receive" "${REPO_PATH}/hooks/post-receive"
     18 chmod u+x "${REPO_PATH}/hooks/post-receive"