From 739e849e108892884c5581464403726b482797a4 Mon Sep 17 00:00:00 2001 From: Trey Bastian Date: Thu, 30 Oct 2025 10:55:56 +0000 Subject: moved some files around to better organiz, added new-repo git command --- git-shell-commands/new-repo | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 git-shell-commands/new-repo (limited to 'git-shell-commands/new-repo') diff --git a/git-shell-commands/new-repo b/git-shell-commands/new-repo new file mode 100644 index 0000000..66f822b --- /dev/null +++ b/git-shell-commands/new-repo @@ -0,0 +1,23 @@ +#!/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.\n" +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 + +#vim: filetype=bash -- cgit v1.2.3