summaryrefslogtreecommitdiff
path: root/git-create
diff options
context:
space:
mode:
authorAdam Carpenter <atc@53hor.net>2020-05-10 21:13:46 -0400
committerAdam Carpenter <atc@53hor.net>2020-05-10 21:13:46 -0400
commitb184782970853b3c479f6c4ad833a36a3aea7afa (patch)
tree318233a807c61414a2696b5300adf3cec6e700e5 /git-create
downloadscripts-b184782970853b3c479f6c4ad833a36a3aea7afa.tar.xz
scripts-b184782970853b3c479f6c4ad833a36a3aea7afa.zip
mega update
Diffstat (limited to 'git-create')
-rwxr-xr-xgit-create30
1 files changed, 30 insertions, 0 deletions
diff --git a/git-create b/git-create
new file mode 100755
index 0000000..af9bb86
--- /dev/null
+++ b/git-create
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# create a repo of provided name on macon and make it the upstream
+name=$1
+[[ ! $(echo "$name" | grep ".git" -) ]] && name="$1.git"
+
+description=$2
+
+echo "'$name': '$description'"
+echo "Create repo?"
+read choice
+[[ ! $choice == "y" ]] && exit 1
+
+ssh git@53hor.net << EOF
+ cd /srv/git
+ git init --bare /srv/git/"$name"
+ cd "$name"
+ rm description
+ echo "$description" > description
+EOF
+
+echo "Mark for export (make clone-able)?"
+read choice
+[[ $choice == "y" ]] && ssh git@53hor.net touch /srv/git/"$name"/git-daemon-export-ok
+
+echo "Clone repo locally?"
+read choice
+[[ ! $choice == "y" ]] && exit 1
+
+git clone git@53hor.net:/srv/git/"$name"