#!/bin/bash # this script allows the creation of new repos over ssh on git server # public repos will get a knot.conf containing the remote # private repos will just exist on the server # USAGE: # ssh git@ new-repo # - follow the prompts echo "oh look you are starting a project you won't finish again." read -p "whats this one called? " PROJECT_NAME if [[ $PROJECT_NAME != *.git ]]; then $PROJECT_NAME = "${PROJECT_NAME}.git" fi read -p "what's the remote(leave blank if private)" REMOTE_URL git --bare init "${PROJECT_NAME}" if [[ $REMOTE_URL ]]; then touch "${PROJECT_NAME}/knot.conf" echo "${REMOTE_URL}" >> "${PROJECT_NAME}/knot.conf" fi echo "git url: ${USER}@${HOSTNAME}:${PROJECT_NAME}" if [[ $REMOTE_URL ]]; then echo "public repo: ${REMOTE_URL}" fi #vim: filetype=bash