Summary Files Commits Branches @commit @diff @stats
path: root / scripts / new
diff options
context:
space:
mode:
1 files changed, 20 insertions, 0 deletions
-rwxr-xr-xscripts/new20
diff --git a/scripts/new b/scripts/new
new file mode 100755
index 0000000..65e677a
--- /dev/null
+++ b/scripts/new
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+while [ -z "$1" ]
+do
+ printf 'Repository: '
+ read
+ set "$REPLY"
+done
+
+set "${1##/}"
+
+root_dir="${1%%/*}"
+repo_dir="${1#*/}"
+
+cd "$root_dir"
+if git init --bare "$repo_dir"
+then
+ echo -e "\nClone repo with:\n\tgit clone git@syndamia.com:$1"
+ echo -e "\nUpload local repo with:\n\tgit push git@syndamia.com:$1 '*:*'"
+fi