new_repo (557B)
1 #!/bin/sh 2 3 REPO="${1}.git" 4 OWNER="pyratebeard" 5 DESC="$2" 6 URL="git://git.pyratebeard.net/${REPO}" 7 REPODIR="/srv/git" 8 9 #test $3 && BRANCH=$3 || BRANCH="main" 10 echo "branch? (main)" ; read BRANCH 11 [ -z ${BRANCH} ] && BRANCH="main" 12 13 sudo mkdir ${REPODIR}/${REPO} && cd ${REPODIR}/${REPO} 14 sudo git init -b ${BRANCH} --bare 15 16 echo "${OWNER}" | sudo tee ./owner 17 echo "${DESC}" | sudo tee ./description 18 echo "${URL}" | sudo tee ./url 19 20 sudo cp /srv/git/git-post-receive-hook hooks/post-receive 21 sudo chmod +x hooks/post-receive 22 23 sudo chown -R git:git ${REPODIR}/${REPO}